Skip to content

Commit 9d60660

Browse files
committed
Ruffed
1 parent 8031205 commit 9d60660

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ def _reset_timer_from_cache(self) -> int | None:
201201
def _sensitivity_level_from_cache(self) -> int | None:
202202
"""Load sensitivity level from cache."""
203203
if (
204-
sensitivity_level := self._get_cache(CACHE_SCAN_CONFIG_SENSITIVITY) # returns level in string CAPITALS
204+
sensitivity_level := self._get_cache(
205+
CACHE_SCAN_CONFIG_SENSITIVITY
206+
) # returns level in string CAPITALS
205207
) is not None:
206208
return MotionSensitivity[sensitivity_level]
207209
return None
@@ -471,9 +473,8 @@ async def _scan_configure_update(self) -> None:
471473
CACHE_SCAN_CONFIG_RESET_TIMER, str(self._motion_config.reset_timer)
472474
)
473475
self._set_cache(
474-
CACHE_SCAN_CONFIG_SENSITIVITY, str(
475-
MotionSensitivity(self._motion_config.sensitivity_level).name
476-
)
476+
CACHE_SCAN_CONFIG_SENSITIVITY,
477+
str(MotionSensitivity(self._motion_config.sensitivity_level).name),
477478
)
478479
self._set_cache(
479480
CACHE_SCAN_CONFIG_DAYLIGHT_MODE, str(self._motion_config.daylight_mode)

plugwise_usb/nodes/sed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ async def _awake_timer(self) -> None:
547547

548548
async def _run_awake_tasks(self) -> None:
549549
"""Execute all awake tasks."""
550-
_LOGGER.debug("_run_awake_tasks | Device %s",self.name)
550+
_LOGGER.debug("_run_awake_tasks | Device %s", self.name)
551551
if (
552552
self._sed_node_info_update_task_scheduled
553553
and await self.node_info_update(None) is not None

tests/test_usb.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,9 +1826,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
18261826
assert await test_node.set_motion_daylight_mode(True) is not None
18271827

18281828
with pytest.raises(pw_exceptions.NodeError):
1829-
assert (
1830-
await test_node.set_motion_sensitivity_level(20) is not None
1831-
)
1829+
assert await test_node.set_motion_sensitivity_level(20) is not None
18321830

18331831
with pytest.raises(pw_exceptions.NodeError):
18341832
assert await test_node.set_motion_reset_timer(5) is not None
@@ -1859,9 +1857,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
18591857
assert await test_node.set_motion_daylight_mode(True) is not None
18601858

18611859
with pytest.raises(pw_exceptions.FeatureError):
1862-
assert (
1863-
await test_node.set_motion_sensitivity_level(20) is not None
1864-
)
1860+
assert await test_node.set_motion_sensitivity_level(20) is not None
18651861

18661862
with pytest.raises(pw_exceptions.FeatureError):
18671863
assert await test_node.set_motion_reset_timer(5) is not None
@@ -1888,9 +1884,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
18881884
with pytest.raises(NotImplementedError):
18891885
assert await test_node.set_motion_daylight_mode(True) is not None
18901886
with pytest.raises(NotImplementedError):
1891-
assert (
1892-
await test_node.set_motion_sensitivity_level(20) is not None
1893-
)
1887+
assert await test_node.set_motion_sensitivity_level(20) is not None
18941888
with pytest.raises(NotImplementedError):
18951889
assert await test_node.set_motion_reset_timer(5) is not None
18961890

@@ -2229,9 +2223,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
22292223

22302224
# test motion sensitivity level
22312225
assert test_scan.sensitivity_level == 30
2232-
assert (
2233-
test_scan.motion_config.sensitivity_level == 30
2234-
)
2226+
assert test_scan.motion_config.sensitivity_level == 30
22352227
assert not await test_scan.set_motion_sensitivity_level(30)
22362228

22372229
assert not test_scan.motion_config.dirty

0 commit comments

Comments
 (0)