Skip to content

Commit 0cec8a5

Browse files
author
autoruff
committed
fixup: xml_to_dict Python code fixed using ruff
1 parent 1e51c42 commit 0cec8a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def reboot(self) -> bool:
120120
async def connect(self) -> Version:
121121
"""Connect to the Plugwise Gateway and determine its name, type, version, and other data."""
122122
result = await self._request(DOMAIN_OBJECTS)
123-
result_str = etree.tostring(result, encoding='utf-8', method='xml')
123+
result_str = etree.tostring(result, encoding="utf-8", method="xml")
124124
result_dict = dict(xmltodict.parse(result_str))
125125
LOGGER.debug("HOI result_dict: %s", json.dumps(result_dict, indent=4))
126126
# Work-around for Stretch fw 2.7.18

tests/test_init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,20 +382,20 @@ async def connect_wrapper(
382382
_LOGGER.warning("Connecting to device exceeding timeout in handling:")
383383
return await self.connect(self.setup_app, raise_timeout=True)
384384

385-
#try:
385+
# try:
386386
# _LOGGER.warning("Connecting to device exceeding timeout in response:")
387387
# await self.connect(self.setup_app, timeout_happened=True)
388388
# _LOGGER.error(" - timeout not handled") # pragma: no cover
389389
# raise self.ConnectError # pragma: no cover
390-
#except pw_exceptions.ConnectionFailedError:
390+
# except pw_exceptions.ConnectionFailedError:
391391
# _LOGGER.info(" + successfully passed timeout handling.")
392392

393-
#try:
393+
# try:
394394
# _LOGGER.warning("Connecting to device with missing data:")
395395
# await self.connect(self.setup_app, broken=True)
396396
# _LOGGER.error(" - broken information not handled") # pragma: no cover
397397
# raise self.ConnectError # pragma: no cover
398-
#except pw_exceptions.InvalidXMLError:
398+
# except pw_exceptions.InvalidXMLError:
399399
# _LOGGER.info(" + successfully passed XML issue handling.")
400400

401401
_LOGGER.info("Connecting to functioning device:")

0 commit comments

Comments
 (0)