Skip to content

Commit d8393ac

Browse files
committed
reduce function calls
return motion property on get_state
1 parent 7c7be1e commit d8393ac

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,6 @@ async def _configure_scan_task(self) -> bool:
437437
"""Configure Scan device settings. Returns True if successful."""
438438
if not self._motion_config.dirty:
439439
return True
440-
if not await self.scan_configure():
441-
_LOGGER.debug("Motion Configuration for %s failed", self._mac_in_str)
442-
return False
443-
return True
444-
445-
async def scan_configure(self) -> bool:
446-
"""Configure Scan device settings. Returns True if successful."""
447-
# Default to medium
448440
request = ScanConfigureRequest(
449441
self._send,
450442
self._mac_in_bytes,
@@ -542,7 +534,7 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
542534
case NodeFeature.MOTION:
543535
states[NodeFeature.MOTION] = self._motion_state
544536
case NodeFeature.MOTION_CONFIG:
545-
states[NodeFeature.MOTION_CONFIG] = self._motion_config
537+
states[NodeFeature.MOTION_CONFIG] = self.motion_config
546538
case _:
547539
state_result = await super().get_state((feature,))
548540
if feature in state_result:

0 commit comments

Comments
 (0)