Skip to content

Commit c4f0e12

Browse files
autoruffbouwew
authored andcommitted
fixup: split_legacy_active Python code fixed using ruff
1 parent 6f589f3 commit c4f0e12

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

plugwise/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
"""
55
from __future__ import annotations
66

7-
import aiohttp
8-
from defusedxml import ElementTree as etree
9-
10-
# Dict as class
11-
# Version detection
12-
import semver
13-
147
from plugwise.constants import (
158
DEFAULT_PORT,
169
DEFAULT_TIMEOUT,
@@ -33,6 +26,13 @@
3326
from plugwise.legacy.smile import SmileLegacyAPI
3427
from plugwise.smile import SmileAPI
3528

29+
import aiohttp
30+
from defusedxml import ElementTree as etree
31+
32+
# Dict as class
33+
# Version detection
34+
import semver
35+
3636

3737
class Smile(SmileComm):
3838
"""The Plugwise SmileConnect class."""

plugwise/helper.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
import datetime as dt
99
from typing import cast
1010

11-
# This way of importing aiohttp is because of patch/mocking in testing (aiohttp timeouts)
12-
from aiohttp import BasicAuth, ClientError, ClientResponse, ClientSession, ClientTimeout
13-
14-
# Time related
15-
from dateutil import tz
16-
from dateutil.parser import parse
17-
from defusedxml import ElementTree as etree
18-
from munch import Munch
19-
2011
from plugwise.constants import (
2112
ACTIVE_ACTUATORS,
2213
ACTUATOR_CLASSES,
@@ -69,7 +60,20 @@
6960
InvalidXMLError,
7061
ResponseError,
7162
)
72-
from plugwise.util import escape_illegal_xml_characters, format_measure, version_to_model
63+
from plugwise.util import (
64+
escape_illegal_xml_characters,
65+
format_measure,
66+
version_to_model,
67+
)
68+
69+
# This way of importing aiohttp is because of patch/mocking in testing (aiohttp timeouts)
70+
from aiohttp import BasicAuth, ClientError, ClientResponse, ClientSession, ClientTimeout
71+
72+
# Time related
73+
from dateutil import tz
74+
from dateutil.parser import parse
75+
from defusedxml import ElementTree as etree
76+
from munch import Munch
7377

7478

7579
def check_model(name: str | None, vendor_name: str | None) -> str | None:

plugwise/smile.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66

77
import datetime as dt
88

9-
import aiohttp
10-
from defusedxml import ElementTree as etree
11-
12-
# Dict as class
13-
from munch import Munch
14-
15-
# Version detection
16-
import semver
17-
189
from plugwise.constants import (
1910
ADAM,
2011
ANNA,
@@ -37,6 +28,15 @@
3728
from plugwise.exceptions import PlugwiseError
3829
from plugwise.helper import SmileComm
3930

31+
import aiohttp
32+
from defusedxml import ElementTree as etree
33+
34+
# Dict as class
35+
from munch import Munch
36+
37+
# Version detection
38+
import semver
39+
4040

4141
class SmileAPI(SmileComm, SmileData):
4242
"""The Plugwise SmileAPI helper class for actual Plugwise devices."""

0 commit comments

Comments
 (0)