Bump quirks for ZHA and handle resulting battery % change (#21869)
* bump quirks and handle battery change * move inside guard * round battery
This commit is contained in:
1 parent
226be65910
commit
ac5ccd651c
3 files changed
+5
-2
No files matched your search
@@ -32,7 +32,7 @@ REQUIREMENTS = [
|
||||
'bellows-homeassistant==0.7.1',
|
||||
'zigpy-homeassistant==0.3.0',
|
||||
'zigpy-xbee-homeassistant==0.1.2',
|
||||
'zha-quirks==0.0.6',
|
||||
'zha-quirks==0.0.7',
|
||||
'zigpy-deconz==0.1.2'
|
||||
]
|
||||
|
||||
|
||||
@@ -147,4 +147,7 @@ class ZhaDeviceEntity(ZhaEntity):
|
||||
battery = await self._battery_channel.get_attribute_value(
|
||||
'battery_percentage_remaining')
|
||||
if battery is not None:
|
||||
# per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯
|
||||
battery = battery / 2
|
||||
battery = int(round(battery))
|
||||
self._device_state_attributes['battery_level'] = battery
|
||||
Reference in new issue
Block a user