forked from home-assistant/core
Disable less popular entities in devolo Home Control (#41945)
This commit is contained in:
@@ -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."""
|
||||
|
@@ -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."""
|
||||
|
@@ -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."""
|
||||
|
Reference in New Issue
Block a user