Improve devolo Home Control (#36557)

This commit is contained in:
Markus Bong 2020-06-08 09:29:09 +02:00 committed by GitHub
parent de7bbd3e24
commit 31dd06bd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 11 deletions

View File

@ -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."""