Fix for 0.98: Don't update disabled entities (Homematic IP Cloud) (#26236)

* Homematic IP Cloud Fix: Don't update disabled entities

* Added enabled to entity.py

* Update test for enabled

* Update entity.py
This commit is contained in:
SukramJ authored and Paulus Schoutsen committed 2019-08-28 13:38:20 -07:00
1 parent e69953fe2d
commit cf3bb300e6
3 files changed
+17 -2

No files matched your search

@@ -76,8 +76,16 @@ class HomematicipGenericDevice(Entity):
def _async_device_changed(self, *args, **kwargs):
"""Handle device state changes."""
_LOGGER.debug("Event %s (%s)", self.name, self._device.modelType)
self.async_schedule_update_ha_state()
# Don't update disabled entities
if self.enabled:
_LOGGER.debug("Event %s (%s)", self.name, self._device.modelType)
self.async_schedule_update_ha_state()
else:
_LOGGER.debug(
"Device Changed Event for %s (%s) not fired. Entity is disabled.",
self.name,
self._device.modelType,
)
@property
def name(self) -> str: