mirror of https://github.com/home-assistant/core
Add additional device classes to devolo Home Control (#49425)
This commit is contained in:
parent
1c587d2e47
commit
208a17d0dc
|
@ -4,6 +4,8 @@ from homeassistant.components.binary_sensor import (
|
|||
DEVICE_CLASS_HEAT,
|
||||
DEVICE_CLASS_MOISTURE,
|
||||
DEVICE_CLASS_MOTION,
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
DEVICE_CLASS_SAFETY,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
@ -19,6 +21,7 @@ DEVICE_CLASS_MAPPING = {
|
|||
"Smoke Alarm": DEVICE_CLASS_SMOKE,
|
||||
"Heat Alarm": DEVICE_CLASS_HEAT,
|
||||
"door": DEVICE_CLASS_DOOR,
|
||||
"overload": DEVICE_CLASS_SAFETY,
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,6 +87,7 @@ class DevoloBinaryDeviceEntity(DevoloDeviceEntity, BinarySensorEntity):
|
|||
self._value = self._binary_sensor_property.state
|
||||
|
||||
if element_uid.startswith("devolo.WarningBinaryFI:"):
|
||||
self._device_class = DEVICE_CLASS_PROBLEM
|
||||
self._enabled_default = False
|
||||
|
||||
@property
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""Platform for sensor integration."""
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_ENERGY,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_ILLUMINANCE,
|
||||
DEVICE_CLASS_POWER,
|
||||
|
@ -21,7 +22,7 @@ DEVICE_CLASS_MAPPING = {
|
|||
"light": DEVICE_CLASS_ILLUMINANCE,
|
||||
"humidity": DEVICE_CLASS_HUMIDITY,
|
||||
"current": DEVICE_CLASS_POWER,
|
||||
"total": DEVICE_CLASS_POWER,
|
||||
"total": DEVICE_CLASS_ENERGY,
|
||||
"voltage": DEVICE_CLASS_VOLTAGE,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue