Fix rooms not being matched correctly in sharkiq.clean_room (#118277)

* Fix rooms not being matched correctly in sharkiq.clean_room

* Update sharkiq tests to account for new room matching logic
pull/118286/head
Ben Thomas 2024-05-28 04:51:51 +01:00 committed by GitHub
parent 0c245f1976
commit 4d7802215c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 1 deletions

View File

@ -212,6 +212,7 @@ class SharkVacuumEntity(CoordinatorEntity[SharkIqUpdateCoordinator], StateVacuum
"""Clean specific rooms."""
rooms_to_clean = []
valid_rooms = self.available_rooms or []
rooms = [room.replace("_", " ").title() for room in rooms]
for room in rooms:
if room in valid_rooms:
rooms_to_clean.append(room)

View File

@ -236,7 +236,6 @@ async def test_device_properties(
@pytest.mark.parametrize(
("room_list", "exception"),
[
(["KITCHEN"], exceptions.ServiceValidationError),
(["KITCHEN", "MUD_ROOM", "DOG HOUSE"], exceptions.ServiceValidationError),
(["Office"], exceptions.ServiceValidationError),
([], MultipleInvalid),