Skip to content

Commit 23a515a

Browse files
committed
Format total_seconds to int
1 parent b7a1e13 commit 23a515a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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).total_seconds > 5
419+
and int((timestamp - self._last_seen).total_seconds()) > 5
420420

421421
):
422422
self._last_seen = timestamp

plugwise_usb/nodes/scan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _motion_from_cache(self) -> bool:
174174
if (
175175
cached_motion_state == "True"
176176
and (motion_timestamp := self._motion_timestamp_from_cache()) is not None
177-
and (datetime.now(tz=UTC) - motion_timestamp).total_seconds < self._reset_timer_from_cache() * 60
177+
and int((datetime.now(tz=UTC) - motion_timestamp).total_seconds()) < self._reset_timer_from_cache() * 60
178178
):
179179
return True
180180
return False
@@ -383,7 +383,7 @@ async def _motion_state_update(
383383
self._set_cache(CACHE_MOTION_STATE, "False")
384384
if self._motion_state.state is None or self._motion_state.state:
385385
if self._reset_timer_motion_on is not None:
386-
reset_timer = (timestamp - self._reset_timer_motion_on).total_seconds
386+
reset_timer = int((timestamp - self._reset_timer_motion_on).total_seconds())
387387
if self._motion_config.reset_timer is None:
388388
self._motion_config = replace(
389389
self._motion_config,

0 commit comments

Comments
 (0)