Skip to content

Commit 389f9b4

Browse files
committed
fix publishing of NodeFeature.MOTION_CONFIG and revert change on NodeFeature.BATTERY
1 parent 7339d83 commit 389f9b4

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ async def load(self) -> None:
102102
await super().load()
103103

104104
self._setup_protocol(SCAN_FIRMWARE_SUPPORT, SCAN_FEATURES)
105-
await self.initialize()
106105
await self._loaded_callback(NodeEvent.LOADED, self.mac)
106+
await self.initialize()
107107

108108
async def initialize(self) -> None:
109109
"""Initialize Scan node."""
@@ -170,11 +170,6 @@ async def _load_from_cache(self) -> bool:
170170
)
171171
if dirty:
172172
await self._scan_configure_update()
173-
else:
174-
await self.publish_feature_update_to_subscribers(
175-
NodeFeature.MOTION_CONFIG,
176-
self._motion_config,
177-
)
178173
return super_load_success
179174

180175
def _daylight_mode_from_cache(self) -> bool | None:
@@ -431,6 +426,10 @@ async def _run_awake_tasks(self) -> None:
431426
await super()._run_awake_tasks()
432427
if self._motion_config.dirty:
433428
await self._configure_scan_task()
429+
await self.publish_feature_update_to_subscribers(
430+
NodeFeature.MOTION_CONFIG,
431+
self._motion_config,
432+
)
434433

435434
async def _configure_scan_task(self) -> bool:
436435
"""Configure Scan device settings. Returns True if successful."""

plugwise_usb/nodes/sed.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ async def _load_from_cache(self) -> bool:
175175
)
176176
if dirty:
177177
await self._sed_configure_update()
178-
else:
179-
await self.publish_feature_update_to_subscribers(
180-
NodeFeature.BATTERY,
181-
self._battery_config,
182-
)
183178
self._awake_timestamp_from_cache()
184179
self._awake_reason_from_cache()
185180
return super_load_success

0 commit comments

Comments
 (0)