Add last clean sensors to Roborock (#100661)

* Add water shortage binary sensor

* add last clean sensors

* fix tests

* fix tests again

* remove accidentally added binary sensor
This commit is contained in:
Luke Lashley 2023-09-21 10:00:15 -04:00 committed by GitHub
parent 6e0ab35f85
commit e2bfa9f9cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -14,7 +14,7 @@ from tests.common import MockConfigEntry
async def test_sensors(hass: HomeAssistant, setup_entry: MockConfigEntry) -> None:
"""Test sensors and check test values are correctly set."""
assert len(hass.states.async_all("sensor")) == 24
assert len(hass.states.async_all("sensor")) == 28
assert hass.states.get("sensor.roborock_s7_maxv_main_brush_time_left").state == str(
MAIN_BRUSH_REPLACE_TIME - 74382
)
@ -39,3 +39,11 @@ async def test_sensors(hass: HomeAssistant, setup_entry: MockConfigEntry) -> Non
assert hass.states.get("sensor.roborock_s7_maxv_vacuum_error").state == "none"
assert hass.states.get("sensor.roborock_s7_maxv_battery").state == "100"
assert hass.states.get("sensor.roborock_s7_maxv_dock_error").state == "ok"
assert (
hass.states.get("sensor.roborock_s7_maxv_last_clean_begin").state
== "2023-01-01T03:22:10+00:00"
)
assert (
hass.states.get("sensor.roborock_s7_maxv_last_clean_end").state
== "2023-01-01T03:43:58+00:00"
)