Disable less popular entities in devolo Home Control (#41945)

This commit is contained in:
Guido Schmitz 2020-10-18 21:07:24 +02:00 committed by GitHub
parent 2604bf59ad
commit e5eae22ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -82,6 +82,9 @@ class DevoloBinaryDeviceEntity(DevoloDeviceEntity, BinarySensorEntity):
self._value = self._binary_sensor_property.state
if element_uid.startswith("devolo.WarningBinaryFI:"):
self._enabled_default = False
@property
def is_on(self):
"""Return the state."""

View File

@ -21,6 +21,7 @@ class DevoloDeviceEntity(Entity):
self._device_class = None
self._value = None
self._unit = None
self._enabled_default = True
# This is not doing I/O. It fetches an internal state of the API
self._available = device_instance.is_online()
@ -60,6 +61,11 @@ class DevoloDeviceEntity(Entity):
"model": self._model,
}
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added to the entity registry."""
return self._enabled_default
@property
def should_poll(self):
"""Return the polling state."""

View File

@ -110,6 +110,9 @@ class DevoloGenericMultiLevelDeviceEntity(DevoloMultiLevelDeviceEntity):
if self._device_class is None:
self._name += f" {self._multi_level_sensor_property.sensor_type}"
if element_uid.startswith("devolo.VoltageMultiLevelSensor:"):
self._enabled_default = False
class DevoloBatteryEntity(DevoloMultiLevelDeviceEntity):
"""Representation of a battery entity within devolo Home Control."""