Skip to content

Commit 9b4da7a

Browse files
committed
Implement another two improvement suggestions
1 parent 448217d commit 9b4da7a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

plugwise_usb/nodes/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ async def _available_update_state(
416416
if (
417417
self._last_seen is not None
418418
and timestamp is not None
419-
and (timestamp - self._last_seen).seconds > 5
419+
and (timestamp - self._last_seen).total_seconds > 5
420420

421421
):
422422
self._last_seen = timestamp

plugwise_usb/nodes/sed.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,23 +453,23 @@ async def _configure_sed_task(self) -> bool:
453453
self.name,
454454
)
455455
self._sed_config_task_scheduled = False
456-
change_required = True
457-
if self._new_battery_config.awake_duration is not None:
458-
change_required = True
459-
if self._new_battery_config.clock_interval is not None:
460-
change_required = True
461-
if self._new_battery_config.clock_sync is not None:
462-
change_required = True
463-
if self._new_battery_config.maintenance_interval is not None:
464-
change_required = True
465-
if self._new_battery_config.sleep_duration is not None:
456+
change_required = False
457+
if (
458+
self._new_battery_config.awake_duration is not None
459+
or self._new_battery_config.clock_interval is not None
460+
or self._new_battery_config.clock_sync is not None
461+
or self._new_battery_config.maintenance_interval is not None
462+
or self._new_battery_config.sleep_duration is not None
463+
):
466464
change_required = True
465+
467466
if not change_required:
468467
_LOGGER.debug(
469468
"_configure_sed_task | Device %s | no change",
470469
self.name,
471470
)
472471
return True
472+
473473
_LOGGER.debug(
474474
"_configure_sed_task | Device %s | request change",
475475
self.name,

0 commit comments

Comments
 (0)