diff --git a/homeassistant/components/hue/binary_sensor.py b/homeassistant/components/hue/binary_sensor.py index e408e995ad4..d5c6953700d 100644 --- a/homeassistant/components/hue/binary_sensor.py +++ b/homeassistant/components/hue/binary_sensor.py @@ -1,5 +1,4 @@ """Hue binary sensor entities.""" - from aiohue.sensors import TYPE_ZLL_PRESENCE from homeassistant.components.binary_sensor import ( @@ -15,9 +14,14 @@ PRESENCE_NAME_FORMAT = "{} motion" async def async_setup_entry(hass, config_entry, async_add_entities): """Defer binary sensor setup to the shared sensor module.""" - await hass.data[HUE_DOMAIN][ - config_entry.entry_id - ].sensor_manager.async_register_component("binary_sensor", async_add_entities) + bridge = hass.data[HUE_DOMAIN][config_entry.entry_id] + + if not bridge.sensor_manager: + return + + await bridge.sensor_manager.async_register_component( + "binary_sensor", async_add_entities + ) class HuePresence(GenericZLLSensor, BinarySensorEntity): diff --git a/homeassistant/components/hue/bridge.py b/homeassistant/components/hue/bridge.py index 698ad9e18e3..776ebbeb1f6 100644 --- a/homeassistant/components/hue/bridge.py +++ b/homeassistant/components/hue/bridge.py @@ -102,7 +102,8 @@ class HueBridge: return False self.api = bridge - self.sensor_manager = SensorManager(self) + if bridge.sensors is not None: + self.sensor_manager = SensorManager(self) hass.config_entries.async_setup_platforms(self.config_entry, PLATFORMS) @@ -178,6 +179,10 @@ class HueBridge: async def hue_activate_scene(self, data, skip_reload=False, hide_warnings=False): """Service to call directly into bridge to set scenes.""" + if self.api.scenes is None: + _LOGGER.warning("Hub %s does not support scenes", self.api.host) + return + group_name = data[ATTR_GROUP_NAME] scene_name = data[ATTR_SCENE_NAME] transition = data.get(ATTR_TRANSITION) diff --git a/homeassistant/components/hue/manifest.json b/homeassistant/components/hue/manifest.json index b86bcd61790..de00d31f2c7 100644 --- a/homeassistant/components/hue/manifest.json +++ b/homeassistant/components/hue/manifest.json @@ -3,7 +3,7 @@ "name": "Philips Hue", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/hue", - "requirements": ["aiohue==2.1.0"], + "requirements": ["aiohue==2.3.0"], "ssdp": [ { "manufacturer": "Royal Philips Electronics", diff --git a/homeassistant/components/hue/sensor.py b/homeassistant/components/hue/sensor.py index 6ac8d134327..3cd3b002f98 100644 --- a/homeassistant/components/hue/sensor.py +++ b/homeassistant/components/hue/sensor.py @@ -26,9 +26,12 @@ TEMPERATURE_NAME_FORMAT = "{} temperature" async def async_setup_entry(hass, config_entry, async_add_entities): """Defer sensor setup to the shared sensor module.""" - await hass.data[HUE_DOMAIN][ - config_entry.entry_id - ].sensor_manager.async_register_component("sensor", async_add_entities) + bridge = hass.data[HUE_DOMAIN][config_entry.entry_id] + + if not bridge.sensor_manager: + return + + await bridge.sensor_manager.async_register_component("sensor", async_add_entities) class GenericHueGaugeSensorEntity(GenericZLLSensor, SensorEntity): diff --git a/requirements_all.txt b/requirements_all.txt index 3a4ea78760a..c7a24db3b5d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -182,7 +182,7 @@ aiohomekit==0.2.61 aiohttp_cors==0.7.0 # homeassistant.components.hue -aiohue==2.1.0 +aiohue==2.3.0 # homeassistant.components.imap aioimaplib==0.7.15 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e8095e104a6..57dfc7c352e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -119,7 +119,7 @@ aiohomekit==0.2.61 aiohttp_cors==0.7.0 # homeassistant.components.hue -aiohue==2.1.0 +aiohue==2.3.0 # homeassistant.components.apache_kafka aiokafka==0.6.0