Roborock fix "selected map" when first map in list is selected (#127126)

* avoid None when current_map = 0

* combine statements
This commit is contained in:
Nerdix 2024-10-01 12:13:11 +02:00 committed by GitHub
parent 5bf5545394
commit 963b9d9a83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -148,6 +148,6 @@ class RoborockCurrentMapSelectEntity(RoborockCoordinatedEntityV1, SelectEntity):
@property @property
def current_option(self) -> str | None: def current_option(self) -> str | None:
"""Get the current status of the select entity from device_status.""" """Get the current status of the select entity from device_status."""
if current_map := self.coordinator.current_map: if (current_map := self.coordinator.current_map) is not None:
return self.coordinator.maps[current_map].name return self.coordinator.maps[current_map].name
return None return None