mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Modified Power events, to always send battery level
This commit is contained in:
parent
a432f9caad
commit
fd42b66753
1 changed files with 2 additions and 1 deletions
|
@ -255,13 +255,14 @@ function createMeshCore(agent) {
|
||||||
{
|
{
|
||||||
require('MeshAgent')._battLevelChanged = function _battLevelChanged(val)
|
require('MeshAgent')._battLevelChanged = function _battLevelChanged(val)
|
||||||
{
|
{
|
||||||
|
_battLevelChanged.self._currentBatteryLevel = val;
|
||||||
_battLevelChanged.self.SendCommand({ action: 'battery', state: _battLevelChanged.self._currentPowerState, level: val });
|
_battLevelChanged.self.SendCommand({ action: 'battery', state: _battLevelChanged.self._currentPowerState, level: val });
|
||||||
};
|
};
|
||||||
require('MeshAgent')._battLevelChanged.self = require('MeshAgent');
|
require('MeshAgent')._battLevelChanged.self = require('MeshAgent');
|
||||||
require('MeshAgent')._powerChanged = function _powerChanged(val)
|
require('MeshAgent')._powerChanged = function _powerChanged(val)
|
||||||
{
|
{
|
||||||
_powerChanged.self._currentPowerState = (val == 'AC' ? 'ac' : 'dc');
|
_powerChanged.self._currentPowerState = (val == 'AC' ? 'ac' : 'dc');
|
||||||
_powerChanged.self.SendCommand({ action: 'battery', state: (val == 'AC' ? 'ac' : 'dc') });
|
_powerChanged.self.SendCommand({ action: 'battery', state: (val == 'AC' ? 'ac' : 'dc'), level: _powerChanged.self._currentBatteryLevel });
|
||||||
};
|
};
|
||||||
require('MeshAgent')._powerChanged.self = require('MeshAgent');
|
require('MeshAgent')._powerChanged.self = require('MeshAgent');
|
||||||
require('MeshAgent').on('Connected', function (status)
|
require('MeshAgent').on('Connected', function (status)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue