Skip to content

Commit b7e5f03

Browse files
author
autoruff
committed
fixup: mdi_scan Python code reformatted using Ruff
1 parent f51e4bb commit b7e5f03

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,26 +326,34 @@ async def set_motion_reset_timer(self, minutes: int) -> bool:
326326
await self._scan_configure_update()
327327
return True
328328

329-
async def set_motion_sensitivity_level(self, level: MotionSensitivity | int | str) -> bool:
329+
async def set_motion_sensitivity_level(
330+
self, level: MotionSensitivity | int | str
331+
) -> bool:
330332
"""Configure the motion sensitivity level."""
331333
_LOGGER.debug(
332334
"set_motion_sensitivity_level | Device %s | %s -> %s",
333335
self.name,
334336
self._motion_config.sensitivity_level,
335337
str(level),
336338
)
337-
if isinstance(level,int):
339+
if isinstance(level, int):
338340
try:
339341
level = MotionSensitivity(level)
340342
except ValueError:
341-
_LOGGER.exception("MotionSensitivity for %s: value error ", self._mac_in_str)
343+
_LOGGER.exception(
344+
"MotionSensitivity for %s: value error ", self._mac_in_str
345+
)
342346
return False
343-
344-
if isinstance(level,str):
347+
348+
if isinstance(level, str):
345349
try:
346350
level = MotionSensitivity[level]
347351
except KeyError:
348-
_LOGGER.exception("MotionSensitivity for %s: unknown level %s", self._mac_in_str,level)
352+
_LOGGER.exception(
353+
"MotionSensitivity for %s: unknown level %s",
354+
self._mac_in_str,
355+
level,
356+
)
349357
return False
350358
if self._motion_config.sensitivity_level == level:
351359
return False

0 commit comments

Comments
 (0)