Use platform tag to register components on hue SensorManager (#32732)
* Use platform tag to register components on hue SensorManager instead of a boolean flag to decide between sensor and binary sensor, so it could be used externally (or to get ready for inclusion of other comps) * Make new item discovery platform agnostic for SensorManager
This commit is contained in:
parent
11a25157c1
commit
94b6ab2862
3 changed files with 14 additions and 17 deletions
|
@ -17,7 +17,7 @@ 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(True, async_add_entities)
|
||||
].sensor_manager.async_register_component("binary_sensor", async_add_entities)
|
||||
|
||||
|
||||
class HuePresence(GenericZLLSensor, BinarySensorDevice):
|
||||
|
@ -44,7 +44,7 @@ class HuePresence(GenericZLLSensor, BinarySensorDevice):
|
|||
SENSOR_CONFIG_MAP.update(
|
||||
{
|
||||
TYPE_ZLL_PRESENCE: {
|
||||
"binary": True,
|
||||
"platform": "binary_sensor",
|
||||
"name_format": PRESENCE_NAME_FORMAT,
|
||||
"class": HuePresence,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue