From 96b7bb625d5e7dc1cbf9633b19aa4c4d4675e25f Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Sun, 26 May 2019 13:01:29 +0100 Subject: [PATCH] geniushub: fix sensor battery level, and bump client (#24123) * Initial commit * bump client --- homeassistant/components/geniushub/manifest.json | 2 +- homeassistant/components/geniushub/sensor.py | 3 ++- requirements_all.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/geniushub/manifest.json b/homeassistant/components/geniushub/manifest.json index e1708d0e836..b2c7286a2d5 100644 --- a/homeassistant/components/geniushub/manifest.json +++ b/homeassistant/components/geniushub/manifest.json @@ -3,7 +3,7 @@ "name": "Genius Hub", "documentation": "https://www.home-assistant.io/components/geniushub", "requirements": [ - "geniushub-client==0.4.9" + "geniushub-client==0.4.11" ], "dependencies": [], "codeowners": ["@zxdavb"] diff --git a/homeassistant/components/geniushub/sensor.py b/homeassistant/components/geniushub/sensor.py index 744906b8f2d..ef148b48143 100644 --- a/homeassistant/components/geniushub/sensor.py +++ b/homeassistant/components/geniushub/sensor.py @@ -76,7 +76,8 @@ class GeniusDevice(Entity): @property def state(self): """Return the state of the sensor.""" - return self._device.state['batteryLevel'] + level = self._device.state['batteryLevel'] + return level if level != 255 else 0 @property def device_state_attributes(self): diff --git a/requirements_all.txt b/requirements_all.txt index 3287c6ef46e..81582926d95 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -487,7 +487,7 @@ gearbest_parser==1.0.7 geizhals==0.0.9 # homeassistant.components.geniushub -geniushub-client==0.4.9 +geniushub-client==0.4.11 # homeassistant.components.geo_json_events # homeassistant.components.nsw_rural_fire_service_feed