From 31dd06bd125fcd4d0b39c2744a99cb8198e09b1a Mon Sep 17 00:00:00 2001 From: Markus Bong Date: Mon, 8 Jun 2020 09:29:09 +0200 Subject: [PATCH] Improve devolo Home Control (#36557) --- .../components/devolo_home_control/devolo_device.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/devolo_home_control/devolo_device.py b/homeassistant/components/devolo_home_control/devolo_device.py index c7986981afc5..1694aeb3f47e 100644 --- a/homeassistant/components/devolo_home_control/devolo_device.py +++ b/homeassistant/components/devolo_home_control/devolo_device.py @@ -8,8 +8,6 @@ from .subscriber import Subscriber _LOGGER = logging.getLogger(__name__) -ATTR_BATTERY_LEVEL = "battery_level" - class DevoloDeviceEntity(Entity): """Representation of a sensor within devolo Home Control.""" @@ -20,16 +18,14 @@ class DevoloDeviceEntity(Entity): self._name = name self._unique_id = element_uid self._homecontrol = homecontrol + + # This is not doing I/O. It fetches an internal state of the API self._available = device_instance.is_online() # Get the brand and model information self._brand = device_instance.brand self._model = device_instance.name - self._state_attrs = {} - if hasattr(self._device_instance, "batteryLevel"): - self._state_attrs = {ATTR_BATTERY_LEVEL: self._device_instance.batteryLevel} - self.subscriber = None self.sync_callback = sync @@ -63,11 +59,6 @@ class DevoloDeviceEntity(Entity): "model": self._model, } - @property - def device_state_attributes(self): - """Return the state attributes of the device.""" - return self._state_attrs - @property def should_poll(self): """Return the polling state."""