mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Deprecate Shelly state attributes (#140791)
This commit is contained in:
@@ -130,6 +130,7 @@ SENSORS: dict[tuple[str, str], BlockBinarySensorDescription] = {
|
|||||||
device_class=BinarySensorDeviceClass.GAS,
|
device_class=BinarySensorDeviceClass.GAS,
|
||||||
translation_key="gas",
|
translation_key="gas",
|
||||||
value=lambda value: value in ["mild", "heavy"],
|
value=lambda value: value in ["mild", "heavy"],
|
||||||
|
# Deprecated, remove in 2025.10
|
||||||
extra_state_attributes=lambda block: {"detected": block.gas},
|
extra_state_attributes=lambda block: {"detected": block.gas},
|
||||||
),
|
),
|
||||||
("sensor", "smoke"): BlockBinarySensorDescription(
|
("sensor", "smoke"): BlockBinarySensorDescription(
|
||||||
|
@@ -358,6 +358,7 @@ SENSORS: dict[tuple[str, str], BlockSensorDescription] = {
|
|||||||
translation_key="lamp_life",
|
translation_key="lamp_life",
|
||||||
value=get_shelly_air_lamp_life,
|
value=get_shelly_air_lamp_life,
|
||||||
suggested_display_precision=1,
|
suggested_display_precision=1,
|
||||||
|
# Deprecated, remove in 2025.10
|
||||||
extra_state_attributes=lambda block: {
|
extra_state_attributes=lambda block: {
|
||||||
"Operational hours": round(cast(int, block.totalWorkTime) / 3600, 1)
|
"Operational hours": round(cast(int, block.totalWorkTime) / 3600, 1)
|
||||||
},
|
},
|
||||||
@@ -378,6 +379,7 @@ SENSORS: dict[tuple[str, str], BlockSensorDescription] = {
|
|||||||
options=["warmup", "normal", "fault"],
|
options=["warmup", "normal", "fault"],
|
||||||
translation_key="operation",
|
translation_key="operation",
|
||||||
value=lambda value: None if value == "unknown" else value,
|
value=lambda value: None if value == "unknown" else value,
|
||||||
|
# Deprecated, remove in 2025.10
|
||||||
extra_state_attributes=lambda block: {"self_test": block.selfTest},
|
extra_state_attributes=lambda block: {"self_test": block.selfTest},
|
||||||
),
|
),
|
||||||
("valve", "valve"): BlockSensorDescription(
|
("valve", "valve"): BlockSensorDescription(
|
||||||
|
Reference in New Issue
Block a user