Add comment for clarity to helper.entity.enabled() (#26793)
* Fixes entity enabled expression * Ensure True is returned when there is no registry_entity * Add comment for clarity to helper.entity.enabled()pull/26893/head
parent
6f9ccb5434
commit
b52cfd3409
|
@ -231,7 +231,11 @@ class Entity:
|
|||
|
||||
@property
|
||||
def enabled(self) -> bool:
|
||||
"""Return if the entity is enabled in the entity registry."""
|
||||
"""Return if the entity is enabled in the entity registry.
|
||||
|
||||
If an entity is not part of the registry, it cannot be disabled
|
||||
and will therefore always be enabled.
|
||||
"""
|
||||
return self.registry_entry is None or not self.registry_entry.disabled
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Reference in New Issue