mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
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:
parent
4d7802215c
commit
f6f6bf8953
@ -263,7 +263,10 @@ class SharkVacuumEntity(CoordinatorEntity[SharkIqUpdateCoordinator], StateVacuum
|
|||||||
@property
|
@property
|
||||||
def available_rooms(self) -> list | None:
|
def available_rooms(self) -> list | None:
|
||||||
"""Return a list of rooms available to clean."""
|
"""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
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any]:
|
def extra_state_attributes(self) -> dict[str, Any]:
|
||||||
|
@ -68,7 +68,7 @@ SHARK_PROPERTIES_DICT = {
|
|||||||
"Robot_Room_List": {
|
"Robot_Room_List": {
|
||||||
"base_type": "string",
|
"base_type": "string",
|
||||||
"read_only": True,
|
"read_only": True,
|
||||||
"value": "Kitchen",
|
"value": "AY001MRT1:Kitchen:Living Room",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user