From b52cfd34098ef3c271a5a8a67047493f1860f3db Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 24 Sep 2019 23:21:00 +0200 Subject: [PATCH] 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() --- homeassistant/helpers/entity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 4911c5d5fb9..fad02dee075 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -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