parent
5d5122c2a4
commit
17fc962a87
homeassistant/components/hue
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue