Skip to content

Commit 2c83c1f

Browse files
authored
Fix image rotation lookup for multiple Roborock devices
1 parent af66180 commit 2c83c1f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • custom_components/roborock_custom_map

custom_components/roborock_custom_map/image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def __init__(
111111

112112
self.config_entry = config_entry
113113
self.map_flag = map_flag
114+
self.rotation_key = f"{coordinator.duid_slug}_{map_flag}"
114115
self._home_trait = home_trait
115116

116117
if not map_name:
@@ -145,7 +146,7 @@ async def async_added_to_hass(self) -> None:
145146
self.async_on_remove(
146147
async_dispatcher_connect(
147148
self.hass,
148-
f"{SIGNAL_ROTATION_CHANGED}_{self.config_entry.entry_id}_{self.map_flag}",
149+
f"{SIGNAL_ROTATION_CHANGED}_{self.config_entry.entry_id}_{self.rotation_key}",
149150
self._handle_rotation_changed,
150151
)
151152
)
@@ -184,7 +185,7 @@ def _get_rotation(self) -> int:
184185
self.hass.data.get(DOMAIN, {})
185186
.get(self.config_entry.entry_id, {})
186187
.get(CONF_MAP_ROTATION, {})
187-
.get(self.map_flag, DEFAULT_MAP_ROTATION)
188+
.get(self.rotation_key, DEFAULT_MAP_ROTATION)
188189
)
189190

190191
if rotation not in MAP_ROTATION_OPTIONS:

0 commit comments

Comments
 (0)