mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 23:25:53 -05:00
Modified Power events, to always send battery level
This commit is contained in:
parent
4e3ce7d420
commit
fd336ead89
@ -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…
Reference in New Issue
Block a user