Skip to content

Commit 3cd0623

Browse files
committed
Reorder functions
1 parent 1e448a7 commit 3cd0623

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

plugwise/__init__.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"""
55
from __future__ import annotations
66

7-
import aiohttp
87
import datetime as dt
8+
9+
import aiohttp
910
from defusedxml import ElementTree as etree
1011

1112
# Dict as class
@@ -481,15 +482,6 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
481482
if result.find(locator_2) is not None:
482483
self._elga = True
483484

484-
async def _full_update_device(self) -> None:
485-
"""Perform a first fetch of all XML data, needed for initialization."""
486-
await self._update_domain_objects()
487-
self._locations = await self._request(LOCATIONS)
488-
self._modules = await self._request(MODULES)
489-
# P1 legacy has no appliances
490-
if not (self.smile_type == "power" and self._smile_legacy):
491-
self._appliances = await self._request(APPLIANCES)
492-
493485
async def _update_domain_objects(self) -> None:
494486
"""Helper-function for smile.py: full_update_device() and async_update().
495487
@@ -512,6 +504,15 @@ async def _update_domain_objects(self) -> None:
512504
f"{self._endpoint}{DOMAIN_OBJECTS}",
513505
)
514506

507+
async def _full_update_device(self) -> None:
508+
"""Perform a first fetch of all XML data, needed for initialization."""
509+
await self._update_domain_objects()
510+
self._locations = await self._request(LOCATIONS)
511+
self._modules = await self._request(MODULES)
512+
# P1 legacy has no appliances
513+
if not (self.smile_type == "power" and self._smile_legacy):
514+
self._appliances = await self._request(APPLIANCES)
515+
515516
async def async_update(self) -> PlugwiseData:
516517
"""Perform an incremental update for updating the various device states."""
517518
# Perform a full update at day-change

0 commit comments

Comments
 (0)