mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Add operation sensor to Shelly Gas (#48462)
This commit is contained in:
parent
be71d626c8
commit
bb7f64596c
@ -128,10 +128,7 @@ SENSORS = {
|
|||||||
("sensor", "concentration"): BlockAttributeDescription(
|
("sensor", "concentration"): BlockAttributeDescription(
|
||||||
name="Gas Concentration",
|
name="Gas Concentration",
|
||||||
unit=CONCENTRATION_PARTS_PER_MILLION,
|
unit=CONCENTRATION_PARTS_PER_MILLION,
|
||||||
value=lambda value: value,
|
|
||||||
icon="mdi:gauge",
|
icon="mdi:gauge",
|
||||||
# "sensorOp" is "normal" when the Shelly Gas is working properly and taking measurements.
|
|
||||||
available=lambda block: block.sensorOp == "normal",
|
|
||||||
),
|
),
|
||||||
("sensor", "extTemp"): BlockAttributeDescription(
|
("sensor", "extTemp"): BlockAttributeDescription(
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
@ -170,6 +167,12 @@ SENSORS = {
|
|||||||
value=lambda value: round(value, 1),
|
value=lambda value: round(value, 1),
|
||||||
device_class=sensor.DEVICE_CLASS_VOLTAGE,
|
device_class=sensor.DEVICE_CLASS_VOLTAGE,
|
||||||
),
|
),
|
||||||
|
("sensor", "sensorOp"): BlockAttributeDescription(
|
||||||
|
name="Operation",
|
||||||
|
icon="mdi:cog-transfer",
|
||||||
|
value=lambda value: value,
|
||||||
|
extra_state_attributes=lambda block: {"self_test": block.selfTest},
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
REST_SENSORS = {
|
REST_SENSORS = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user