Skip to content

Commit 90a8125

Browse files
committed
Break-out two more functions
1 parent 2eda0ce commit 90a8125

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

plugwise/helper.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,14 @@ def _all_appliances(self) -> None:
337337

338338
self._create_gw_entities(appl)
339339

340-
# For P1 collect the connected SmartMeter info from the Home/building
341-
# location, there is no appliance available for this device.
340+
self._get_smartmeter_info()
341+
self._sort_gw_entities()
342+
343+
def _get_smartmeter_info(self) -> None:
344+
"""For P1 collect the connected SmartMeter info from the Home/buildinglocation.
345+
346+
There is no appliance available for this device.
347+
"""
342348
if self.smile_type == "power":
343349
self._p1_smartmeter_info_finder()
344350
# P1: for gateway and smartmeter switch entity_id - part 2
@@ -348,7 +354,8 @@ def _all_appliances(self) -> None:
348354
# Leave for-loop to avoid a 2nd device_id switch
349355
break
350356

351-
# Place the gateway and optional heater_central devices as 1st and 2nd
357+
def _sort_gw_entities(self) -> None:
358+
"""Place the gateway and optional heater_central devices as 1st and 2nd."""
352359
for dev_class in ("heater_central", "gateway"):
353360
for entity_id, entity in dict(self.gw_entities).items():
354361
if entity["dev_class"] == dev_class:

0 commit comments

Comments
 (0)