Skip to content

Commit a8826d4

Browse files
committed
Improve _get_appliances() return logic
1 parent fd94f75 commit a8826d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugwise/helper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,18 @@ def _get_appliances(self) -> bool:
178178
self._reorder_devices()
179179

180180
removed = list(set(self._existing_appliances) - set(self._new_appliances))
181+
new = list(set(self._new_appliances) - set(self._existing_appliances))
181182
if self._existing_appliances:
182183
for appliance in removed:
183184
self.gw_entities.pop(appliance)
184-
return False
185185

186186
self._existing_appliances = self._new_appliances
187187
self._new_appliances = []
188-
return True
188+
189+
if new:
190+
return True
191+
192+
return False
189193

190194
def _add_p1_smartmeter_info(self) -> None:
191195
"""For P1 collect the smartmeter info from the Home/building location and add it as an entity.

0 commit comments

Comments
 (0)