Use isinstance to verify class in deCONZ integration (#56794)
* Don't enable any variants of the daylight sensor entities by default * Use isinstance rather than doing ZHATYPE compare * Accidentally removed an import
This commit is contained in:
parent
0463007050
commit
f224ab6d67
13 changed files with 95 additions and 86 deletions
|
@ -84,13 +84,12 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
|
||||
for sensor in sensors:
|
||||
|
||||
if not gateway.option_allow_clip_sensor and sensor.type.startswith("CLIP"):
|
||||
continue
|
||||
|
||||
if (
|
||||
sensor.type in Thermostat.ZHATYPE
|
||||
isinstance(sensor, Thermostat)
|
||||
and sensor.unique_id not in gateway.entities[DOMAIN]
|
||||
and (
|
||||
gateway.option_allow_clip_sensor
|
||||
or not sensor.type.startswith("CLIP")
|
||||
)
|
||||
):
|
||||
entities.append(DeconzThermostat(sensor, gateway))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue