fix battery interface implementation in philips hue

master
Michael Zanetti 2018-03-12 21:31:12 +01:00
parent d8b84bae5b
commit f07031e589
2 changed files with 11 additions and 3 deletions

View File

@ -550,7 +550,8 @@ void DevicePluginPhilipsHue::remoteStateChanged()
}
device->setStateValue(hueRemoteConnectedStateTypeId, remote->reachable());
device->setStateValue(hueRemoteBatteryStateTypeId, remote->battery());
device->setStateValue(hueRemoteBatteryLevelStateTypeId, remote->battery());
device->setStateValue(hueRemoteBatteryCriticalStateTypeId, remote->battery() < 5);
}
void DevicePluginPhilipsHue::onRemoteButtonEvent(const int &buttonCode)

View File

@ -527,15 +527,22 @@
},
{
"id": "683e493a-9796-4d5e-b0e3-61cb178d5819",
"name": "battery",
"name": "batteryLevel",
"displayName": "battery",
"displayNameEvent": "battery changed",
"displayNameAction": "Set battery",
"type": "int",
"unit": "Percentage",
"defaultValue": 0,
"minValue": 0,
"maxValue": 100
},
{
"id": "f8516899-6312-4110-bb97-70ffa81dc530",
"name": "batteryCritical",
"displayName": "battery critical",
"displayNameEvent": "battery critical changed",
"type": "bool",
"defaultValue": false
}
],
"eventTypes": [