Skip to content

Commit 6f8439d

Browse files
authored
Fix switch platform for Comelit SimpleHome (home-assistant#154227)
1 parent f649717 commit 6f8439d

File tree

1 file changed

+3
-3
lines changed
  • homeassistant/components/comelit

1 file changed

+3
-3
lines changed

homeassistant/components/comelit/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def new_device_listener(
138138
data_type: str,
139139
) -> Callable[[], None]:
140140
"""Subscribe to coordinator updates to check for new devices."""
141-
known_devices: set[int] = set()
141+
known_devices: dict[str, list[int]] = {}
142142

143143
def _check_devices() -> None:
144144
"""Check for new devices and call callback with any new monitors."""
@@ -147,8 +147,8 @@ def _check_devices() -> None:
147147

148148
new_devices: list[DeviceType] = []
149149
for _id in coordinator.data[data_type]:
150-
if _id not in known_devices:
151-
known_devices.add(_id)
150+
if _id not in (id_list := known_devices.get(data_type, [])):
151+
known_devices.update({data_type: [*id_list, _id]})
152152
new_devices.append(coordinator.data[data_type][_id])
153153

154154
if new_devices:

0 commit comments

Comments
 (0)