Add missing sensors after reworking sensor platform in Shelly integration (#39765)
parent
a45f5c7831
commit
748e2696dc
|
@ -3,6 +3,7 @@ from homeassistant.components.binary_sensor import (
|
|||
DEVICE_CLASS_GAS,
|
||||
DEVICE_CLASS_MOISTURE,
|
||||
DEVICE_CLASS_OPENING,
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
DEVICE_CLASS_VIBRATION,
|
||||
BinarySensorEntity,
|
||||
|
@ -15,8 +16,18 @@ from .entity import (
|
|||
)
|
||||
|
||||
SENSORS = {
|
||||
("device", "overtemp"): BlockAttributeDescription(name="overtemp"),
|
||||
("relay", "overpower"): BlockAttributeDescription(name="overpower"),
|
||||
("device", "overtemp"): BlockAttributeDescription(
|
||||
name="Overheating", device_class=DEVICE_CLASS_PROBLEM
|
||||
),
|
||||
("device", "overpower"): BlockAttributeDescription(
|
||||
name="Over Power", device_class=DEVICE_CLASS_PROBLEM
|
||||
),
|
||||
("light", "overpower"): BlockAttributeDescription(
|
||||
name="Over Power", device_class=DEVICE_CLASS_PROBLEM
|
||||
),
|
||||
("relay", "overpower"): BlockAttributeDescription(
|
||||
name="Over Power", device_class=DEVICE_CLASS_PROBLEM
|
||||
),
|
||||
("sensor", "dwIsOpened"): BlockAttributeDescription(
|
||||
name="Door", device_class=DEVICE_CLASS_OPENING
|
||||
),
|
||||
|
|
|
@ -40,6 +40,43 @@ SENSORS = {
|
|||
device_class=sensor.DEVICE_CLASS_POWER,
|
||||
default_enabled=False,
|
||||
),
|
||||
("device", "power"): BlockAttributeDescription(
|
||||
name="Power",
|
||||
unit=POWER_WATT,
|
||||
value=lambda value: round(value, 1),
|
||||
device_class=sensor.DEVICE_CLASS_POWER,
|
||||
),
|
||||
("emeter", "power"): BlockAttributeDescription(
|
||||
name="Power",
|
||||
unit=POWER_WATT,
|
||||
value=lambda value: round(value, 1),
|
||||
device_class=sensor.DEVICE_CLASS_POWER,
|
||||
),
|
||||
("relay", "power"): BlockAttributeDescription(
|
||||
name="Power",
|
||||
unit=POWER_WATT,
|
||||
value=lambda value: round(value, 1),
|
||||
device_class=sensor.DEVICE_CLASS_POWER,
|
||||
),
|
||||
("device", "energy"): BlockAttributeDescription(
|
||||
name="Energy",
|
||||
unit=ENERGY_KILO_WATT_HOUR,
|
||||
value=lambda value: round(value / 60 / 1000, 2),
|
||||
device_class=sensor.DEVICE_CLASS_ENERGY,
|
||||
),
|
||||
("emeter", "energy"): BlockAttributeDescription(
|
||||
name="Energy",
|
||||
unit=ENERGY_KILO_WATT_HOUR,
|
||||
value=lambda value: round(value / 1000, 2),
|
||||
device_class=sensor.DEVICE_CLASS_ENERGY,
|
||||
),
|
||||
("light", "energy"): BlockAttributeDescription(
|
||||
name="Energy",
|
||||
unit=ENERGY_KILO_WATT_HOUR,
|
||||
value=lambda value: round(value / 60 / 1000, 2),
|
||||
device_class=sensor.DEVICE_CLASS_ENERGY,
|
||||
default_enabled=False,
|
||||
),
|
||||
("relay", "energy"): BlockAttributeDescription(
|
||||
name="Energy",
|
||||
unit=ENERGY_KILO_WATT_HOUR,
|
||||
|
|
Loading…
Reference in New Issue