mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
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()
This commit is contained in:
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…
x
Reference in New Issue
Block a user