SharkIQ Fix for vacuums without room support (#118209)

* Fix SharkIQ vacuums without room support crashing the SharkIQ integration

* Fix ruff format

* Fix SharkIQ tests to account for robot identifier and second expected value
This commit is contained in:
Ben Thomas 2024-05-28 04:57:21 +01:00 committed by GitHub
parent 4d7802215c
commit f6f6bf8953
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -263,7 +263,10 @@ class SharkVacuumEntity(CoordinatorEntity[SharkIqUpdateCoordinator], StateVacuum
@property
def available_rooms(self) -> list | None:
"""Return a list of rooms available to clean."""
return self.sharkiq.get_room_list()
room_list = self.sharkiq.get_property_value(Properties.ROBOT_ROOM_LIST)
if room_list:
return room_list.split(":")[1:]
return []
@property
def extra_state_attributes(self) -> dict[str, Any]:

View File

@ -68,7 +68,7 @@ SHARK_PROPERTIES_DICT = {
"Robot_Room_List": {
"base_type": "string",
"read_only": True,
"value": "Kitchen",
"value": "AY001MRT1:Kitchen:Living Room",
},
}