mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +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,
|
||||
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": {
|
||||
"name": "Water box attached"
|
||||
},
|
||||
"water_shortage": {
|
||||
"name": "Water shortage"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
|
@ -9,9 +9,12 @@ async def test_binary_sensors(
|
||||
hass: HomeAssistant, setup_entry: MockConfigEntry
|
||||
) -> None:
|
||||
"""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_water_box_attached").state
|
||||
== "on"
|
||||
)
|
||||
assert (
|
||||
hass.states.get("binary_sensor.roborock_s7_maxv_water_shortage").state == "off"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user