mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
deCONZ - Revert from using disabled_by when setting options (#31446)
* Revert from using disabled_by when setting options * Remove signalling for changed options * Evaluate allow group option earlier when adding a group
This commit is contained in:
@@ -8,7 +8,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
|
||||
from .deconz_device import DeconzDevice
|
||||
from .gateway import DeconzEntityHandler, get_gateway_from_config_entry
|
||||
from .gateway import get_gateway_from_config_entry
|
||||
|
||||
ATTR_ORIENTATION = "orientation"
|
||||
ATTR_TILTANGLE = "tiltangle"
|
||||
@@ -23,8 +23,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
"""Set up the deCONZ binary sensor."""
|
||||
gateway = get_gateway_from_config_entry(hass, config_entry)
|
||||
|
||||
entity_handler = DeconzEntityHandler(gateway)
|
||||
|
||||
@callback
|
||||
def async_add_sensor(sensors, new=True):
|
||||
"""Add binary sensor from deCONZ."""
|
||||
@@ -32,10 +30,15 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
for sensor in sensors:
|
||||
|
||||
if new and sensor.BINARY:
|
||||
new_sensor = DeconzBinarySensor(sensor, gateway)
|
||||
entity_handler.add_entity(new_sensor)
|
||||
entities.append(new_sensor)
|
||||
if (
|
||||
new
|
||||
and sensor.BINARY
|
||||
and (
|
||||
gateway.option_allow_clip_sensor
|
||||
or not sensor.type.startswith("CLIP")
|
||||
)
|
||||
):
|
||||
entities.append(DeconzBinarySensor(sensor, gateway))
|
||||
|
||||
async_add_entities(entities, True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user