mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add water shortage binary sensor (#100662)
This commit is contained in:
parent
a08b74c550
commit
6e0ab35f85
@ -61,6 +61,14 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda data: data.status.water_box_status,
|
value_fn=lambda data: data.status.water_box_status,
|
||||||
),
|
),
|
||||||
|
RoborockBinarySensorDescription(
|
||||||
|
key="water_shortage",
|
||||||
|
translation_key="water_shortage",
|
||||||
|
icon="mdi:water",
|
||||||
|
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
value_fn=lambda data: data.status.water_shortage_status,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,9 @@
|
|||||||
},
|
},
|
||||||
"water_box_attached": {
|
"water_box_attached": {
|
||||||
"name": "Water box attached"
|
"name": "Water box attached"
|
||||||
|
},
|
||||||
|
"water_shortage": {
|
||||||
|
"name": "Water shortage"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"number": {
|
"number": {
|
||||||
|
@ -9,9 +9,12 @@ async def test_binary_sensors(
|
|||||||
hass: HomeAssistant, setup_entry: MockConfigEntry
|
hass: HomeAssistant, setup_entry: MockConfigEntry
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test binary sensors and check test values are correctly set."""
|
"""Test binary sensors and check test values are correctly set."""
|
||||||
assert len(hass.states.async_all("binary_sensor")) == 4
|
assert len(hass.states.async_all("binary_sensor")) == 6
|
||||||
assert hass.states.get("binary_sensor.roborock_s7_maxv_mop_attached").state == "on"
|
assert hass.states.get("binary_sensor.roborock_s7_maxv_mop_attached").state == "on"
|
||||||
assert (
|
assert (
|
||||||
hass.states.get("binary_sensor.roborock_s7_maxv_water_box_attached").state
|
hass.states.get("binary_sensor.roborock_s7_maxv_water_box_attached").state
|
||||||
== "on"
|
== "on"
|
||||||
)
|
)
|
||||||
|
assert (
|
||||||
|
hass.states.get("binary_sensor.roborock_s7_maxv_water_shortage").state == "off"
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user