Skip to content

Commit 532f108

Browse files
committed
Fix: Make current_rooms property return None if current_map_data is None.
1 parent 924f106 commit 532f108

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roborock/devices/traits/v1/home.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ def current_map_data(self) -> CombinedMapInfo | None:
222222
return self._home_map_info.get(current_map_flag)
223223

224224
@property
225-
def current_rooms(self) -> list[NamedRoomMapping]:
225+
def current_rooms(self) -> list[NamedRoomMapping] | None:
226226
"""Returns the room names for the current map."""
227+
if self.current_map_data is None:
228+
return None
227229
return self.current_map_data.rooms
228230

229231
@property

0 commit comments

Comments
 (0)