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:
David F. Mulcahey 2019-03-09 15:14:58 -05:00 committed by Paulus Schoutsen
parent 226be65910
commit ac5ccd651c
3 changed files with 5 additions and 2 deletions

View File

@ -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'
]

View File

@ -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

View File

@ -1826,7 +1826,7 @@ zengge==0.2
zeroconf==0.21.3
# homeassistant.components.zha
zha-quirks==0.0.6
zha-quirks==0.0.7
# homeassistant.components.climate.zhong_hong
zhong_hong_hvac==1.0.9