Skip to content

Commit

Permalink
Fix HC3 compatibility further (home-assistant#38931)
Browse files Browse the repository at this point in the history
* Update __init__.py

Further fixes for HC3 compatibility.

* Update homeassistant/components/fibaro/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
  • Loading branch information
2 people authored and weissm committed Aug 28, 2020
1 parent d929a84 commit eafbe72
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions homeassistant/components/fibaro/__init__.py
Expand Up @@ -235,10 +235,10 @@ def _read_scenes(self):
scenes = self._client.scenes.list()
self._scene_map = {}
for device in scenes:
if "visible" in device and not device.visible:
if "name" not in device or "id" not in device:
continue
device.fibaro_controller = self
if device.roomID == 0:
if "roomID" not in device or device.roomID == 0:
room_name = "Unknown"
else:
room_name = self._room_map[device.roomID].name
Expand All @@ -250,6 +250,7 @@ def _read_scenes(self):
device.unique_id_str = f"{self.hub_serial}.scene.{device.id}"
self._scene_map[device.id] = device
self.fibaro_devices["scene"].append(device)
_LOGGER.debug("%s scene -> %s", device.ha_id, device)

def _read_devices(self):
"""Read and process the device list."""
Expand All @@ -259,8 +260,10 @@ def _read_devices(self):
last_climate_parent = None
for device in devices:
try:
if "name" not in device or "id" not in device:
continue
device.fibaro_controller = self
if device.roomID == 0:
if "roomID" not in device or device.roomID == 0:
room_name = "Unknown"
else:
room_name = self._room_map[device.roomID].name
Expand Down

0 comments on commit eafbe72

Please sign in to comment.