Fix geniushub issue #24530 (via a client bump) & handle edge cases (#24546)

* bump client library to workaround #24530

* bump client library to workaround #24530 2/2

* bump client library to workaround #24530

* bump client library to workaround #24530 2/2

* bugfix: ghost devices cause TypeError: 'NoneType' object is not subscriptable

* bugfix: broken HW zones cause AttributeError: 'GeniusZone' object has no attribute 'temperature'

* delint
This commit is contained in:
David Bonnes 2019-06-17 17:27:06 +01:00 committed by Paulus Schoutsen
parent 56155740fe
commit ffce593cc8
4 changed files with 8 additions and 4 deletions

View File

@ -18,8 +18,9 @@ async def async_setup_platform(hass, config, async_add_entities,
"""Set up the Genius Hub sensor entities.""" """Set up the Genius Hub sensor entities."""
client = hass.data[DOMAIN]['client'] client = hass.data[DOMAIN]['client']
devices = [d for d in client.hub.device_objs if d.type is not None]
switches = [GeniusBinarySensor(client, d) switches = [GeniusBinarySensor(client, d)
for d in client.hub.device_objs if d.type[:21] in GH_IS_SWITCH] for d in devices if d.type[:21] in GH_IS_SWITCH]
async_add_entities(switches) async_add_entities(switches)

View File

@ -3,7 +3,7 @@
"name": "Genius Hub", "name": "Genius Hub",
"documentation": "https://www.home-assistant.io/components/geniushub", "documentation": "https://www.home-assistant.io/components/geniushub",
"requirements": [ "requirements": [
"geniushub-client==0.4.11" "geniushub-client==0.4.12"
], ],
"dependencies": [], "dependencies": [],
"codeowners": ["@zxdavb"] "codeowners": ["@zxdavb"]

View File

@ -94,7 +94,10 @@ class GeniusWaterHeater(WaterHeaterDevice):
@property @property
def current_temperature(self): def current_temperature(self):
"""Return the current temperature.""" """Return the current temperature."""
return self._boiler.temperature try:
return self._boiler.temperature
except AttributeError:
return None
@property @property
def target_temperature(self): def target_temperature(self):

View File

@ -494,7 +494,7 @@ gearbest_parser==1.0.7
geizhals==0.0.9 geizhals==0.0.9
# homeassistant.components.geniushub # homeassistant.components.geniushub
geniushub-client==0.4.11 geniushub-client==0.4.12
# homeassistant.components.geo_json_events # homeassistant.components.geo_json_events
# homeassistant.components.nsw_rural_fire_service_feed # homeassistant.components.nsw_rural_fire_service_feed