mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add cleaning binary sensor to Roborock (#102748)
This commit is contained in:
parent
ece7ec6a38
commit
dd111416e7
@ -69,6 +69,14 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda data: data.status.water_shortage_status,
|
value_fn=lambda data: data.status.water_shortage_status,
|
||||||
),
|
),
|
||||||
|
RoborockBinarySensorDescription(
|
||||||
|
key="in_cleaning",
|
||||||
|
translation_key="in_cleaning",
|
||||||
|
icon="mdi:vacuum",
|
||||||
|
device_class=BinarySensorDeviceClass.RUNNING,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
value_fn=lambda data: data.status.in_cleaning,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
},
|
},
|
||||||
"entity": {
|
"entity": {
|
||||||
"binary_sensor": {
|
"binary_sensor": {
|
||||||
|
"in_cleaning": {
|
||||||
|
"name": "Cleaning"
|
||||||
|
},
|
||||||
"mop_attached": {
|
"mop_attached": {
|
||||||
"name": "Mop attached"
|
"name": "Mop attached"
|
||||||
},
|
},
|
||||||
|
@ -9,7 +9,7 @@ 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")) == 6
|
assert len(hass.states.async_all("binary_sensor")) == 8
|
||||||
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
|
||||||
@ -18,3 +18,4 @@ async def test_binary_sensors(
|
|||||||
assert (
|
assert (
|
||||||
hass.states.get("binary_sensor.roborock_s7_maxv_water_shortage").state == "off"
|
hass.states.get("binary_sensor.roborock_s7_maxv_water_shortage").state == "off"
|
||||||
)
|
)
|
||||||
|
assert hass.states.get("binary_sensor.roborock_s7_maxv_cleaning").state == "off"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user