mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Small optimization in entity registry enabled deConz method (#51250)
This commit is contained in:
parent
32dc62a996
commit
c317854e86
@ -58,15 +58,12 @@ class DeconzDevice(DeconzBase, Entity):
|
|||||||
self.gateway.entities[self.TYPE].add(self.unique_id)
|
self.gateway.entities[self.TYPE].add(self.unique_id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def entity_registry_enabled_default(self):
|
def entity_registry_enabled_default(self) -> bool:
|
||||||
"""Return if the entity should be enabled when first added to the entity registry.
|
"""Return if the entity should be enabled when first added to the entity registry.
|
||||||
|
|
||||||
Daylight is a virtual sensor from deCONZ that should never be enabled by default.
|
Daylight is a virtual sensor from deCONZ that should never be enabled by default.
|
||||||
"""
|
"""
|
||||||
if self._device.type == "Daylight":
|
return self._device.type != "Daylight"
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Subscribe to device events."""
|
"""Subscribe to device events."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user