mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Add missing sensors after reworking sensor platform in Shelly integration (#39765)
This commit is contained in:
parent
a45f5c7831
commit
748e2696dc
@ -3,6 +3,7 @@ from homeassistant.components.binary_sensor import (
|
|||||||
DEVICE_CLASS_GAS,
|
DEVICE_CLASS_GAS,
|
||||||
DEVICE_CLASS_MOISTURE,
|
DEVICE_CLASS_MOISTURE,
|
||||||
DEVICE_CLASS_OPENING,
|
DEVICE_CLASS_OPENING,
|
||||||
|
DEVICE_CLASS_PROBLEM,
|
||||||
DEVICE_CLASS_SMOKE,
|
DEVICE_CLASS_SMOKE,
|
||||||
DEVICE_CLASS_VIBRATION,
|
DEVICE_CLASS_VIBRATION,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
@ -15,8 +16,18 @@ from .entity import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
SENSORS = {
|
SENSORS = {
|
||||||
("device", "overtemp"): BlockAttributeDescription(name="overtemp"),
|
("device", "overtemp"): BlockAttributeDescription(
|
||||||
("relay", "overpower"): BlockAttributeDescription(name="overpower"),
|
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(
|
("sensor", "dwIsOpened"): BlockAttributeDescription(
|
||||||
name="Door", device_class=DEVICE_CLASS_OPENING
|
name="Door", device_class=DEVICE_CLASS_OPENING
|
||||||
),
|
),
|
||||||
|
@ -40,6 +40,43 @@ SENSORS = {
|
|||||||
device_class=sensor.DEVICE_CLASS_POWER,
|
device_class=sensor.DEVICE_CLASS_POWER,
|
||||||
default_enabled=False,
|
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(
|
("relay", "energy"): BlockAttributeDescription(
|
||||||
name="Energy",
|
name="Energy",
|
||||||
unit=ENERGY_KILO_WATT_HOUR,
|
unit=ENERGY_KILO_WATT_HOUR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user