Skip to content

Commit f7d4138

Browse files
committed
properly propagate configuration changes
1 parent 757787c commit f7d4138

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ 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+
)
173178
return super_load_success
174179

175180
def _daylight_mode_from_cache(self) -> bool | None:

plugwise_usb/nodes/sed.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ 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+
)
178183
self._awake_timestamp_from_cache()
179184
self._awake_reason_from_cache()
180185
return super_load_success
@@ -243,6 +248,7 @@ async def set_awake_duration(self, seconds: int) -> bool:
243248
awake_duration=seconds,
244249
dirty=True,
245250
)
251+
await self._sed_configure_update()
246252
return True
247253

248254
async def set_clock_interval(self, minutes: int) -> bool:
@@ -264,6 +270,7 @@ async def set_clock_interval(self, minutes: int) -> bool:
264270
self._battery_config = replace(
265271
self._battery_config, clock_interval=minutes, dirty=True
266272
)
273+
await self._sed_configure_update()
267274
return True
268275

269276
async def set_clock_sync(self, sync: bool) -> bool:
@@ -280,6 +287,7 @@ async def set_clock_sync(self, sync: bool) -> bool:
280287
self._battery_config = replace(
281288
self._battery_config, clock_sync=sync, dirty=True
282289
)
290+
await self._sed_configure_update()
283291
return True
284292

285293
async def set_maintenance_interval(self, minutes: int) -> bool:
@@ -301,6 +309,7 @@ async def set_maintenance_interval(self, minutes: int) -> bool:
301309
self._battery_config = replace(
302310
self._battery_config, maintenance_interval=minutes, dirty=True
303311
)
312+
await self._sed_configure_update()
304313
return True
305314

306315
async def set_sleep_duration(self, minutes: int) -> bool:
@@ -325,6 +334,7 @@ async def set_sleep_duration(self, minutes: int) -> bool:
325334
self._battery_config = replace(
326335
self._battery_config, sleep_duration=minutes, dirty=True
327336
)
337+
await self._sed_configure_update()
328338
return True
329339

330340
# endregion

0 commit comments

Comments
 (0)