Skip to content

Commit 6c2e33f

Browse files
committed
simplify motion config dirty state
simplify sed config dirty state
1 parent d3e8c07 commit 6c2e33f

File tree

7 files changed

+269
-404
lines changed

7 files changed

+269
-404
lines changed

plugwise_usb/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class BatteryConfig:
118118
clock_sync: bool | None: Indicate if the internal clock must be synced.
119119
maintenance_interval: int | None: Interval in minutes a battery powered devices is awake for maintenance purposes.
120120
sleep_duration: int | None: Interval in minutes a battery powered devices is sleeping.
121+
dirty: bool: Settings changed, device update pending
121122
122123
"""
123124

@@ -126,6 +127,7 @@ class BatteryConfig:
126127
clock_sync: bool | None = None
127128
maintenance_interval: int | None = None
128129
sleep_duration: int | None = None
130+
dirty: bool = False
129131

130132

131133
@dataclass
@@ -232,12 +234,14 @@ class MotionConfig:
232234
reset_timer: int | None: Motion reset timer in minutes before the motion detection is switched off.
233235
daylight_mode: bool | None: Motion detection when light level is below threshold.
234236
sensitivity_level: MotionSensitivity | None: Motion sensitivity level.
237+
dirty: bool: Settings changed, device update pending
235238
236239
"""
237240

238241
daylight_mode: bool | None = None
239242
reset_timer: int | None = None
240243
sensitivity_level: MotionSensitivity | None = None
244+
dirty: bool = False
241245

242246

243247
@dataclass

plugwise_usb/nodes/circle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,13 @@ async def _load_defaults(self) -> None:
973973
"""Load default configuration settings."""
974974
if self._node_info.model is None:
975975
self._node_info.model = "Circle"
976+
self._sed_node_info_update_task_scheduled = True
976977
if self._node_info.name is None:
977978
self._node_info.name = f"Circle {self._node_info.mac[-5:]}"
979+
self._sed_node_info_update_task_scheduled = True
978980
if self._node_info.firmware is None:
979981
self._node_info.firmware = DEFAULT_FIRMWARE
982+
self._sed_node_info_update_task_scheduled = True
980983

981984
@raise_not_loaded
982985
async def initialize(self) -> bool:

0 commit comments

Comments
 (0)