|
|
@@ -128,13 +128,11 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
|
|
|
if not self._is_mode_sync_on():
|
|
|
return
|
|
|
|
|
|
- now = dt_util.now()
|
|
|
+ now = dt_util.now().replace(tzinfo=None)
|
|
|
|
|
|
# At next reservation's check-in: promote next → current, then activate guest mode.
|
|
|
if nxt.check_in_date and nxt.check_in_time:
|
|
|
- check_in = dt_util.as_local(
|
|
|
- datetime.combine(nxt.check_in_date, nxt.check_in_time)
|
|
|
- )
|
|
|
+ check_in = datetime.combine(nxt.check_in_date, nxt.check_in_time)
|
|
|
delay = (check_in - now).total_seconds()
|
|
|
if delay > 0:
|
|
|
self._mode_sync_handles.append(
|
|
|
@@ -143,9 +141,7 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
|
|
|
|
|
|
# At current reservation's check-out: clear current, then deactivate guest mode.
|
|
|
if current.check_out_date and current.check_out_time:
|
|
|
- check_out = dt_util.as_local(
|
|
|
- datetime.combine(current.check_out_date, current.check_out_time)
|
|
|
- )
|
|
|
+ check_out = datetime.combine(current.check_out_date, current.check_out_time)
|
|
|
delay = (check_out - now).total_seconds()
|
|
|
if delay > 0:
|
|
|
self._mode_sync_handles.append(
|
|
|
@@ -157,12 +153,12 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
|
|
|
Returns 'active' if now is within check_in..check_out, 'elapsed' if past check_out,
|
|
|
'pending' if before check_in, or None if the reservation has no datetime info.
|
|
|
"""
|
|
|
- now = dt_util.now()
|
|
|
+ now = dt_util.now().replace(tzinfo=None)
|
|
|
check_in = check_out = None
|
|
|
if res.check_in_date and res.check_in_time:
|
|
|
- check_in = dt_util.as_local(datetime.combine(res.check_in_date, res.check_in_time))
|
|
|
+ check_in = datetime.combine(res.check_in_date, res.check_in_time)
|
|
|
if res.check_out_date and res.check_out_time:
|
|
|
- check_out = dt_util.as_local(datetime.combine(res.check_out_date, res.check_out_time))
|
|
|
+ check_out = datetime.combine(res.check_out_date, res.check_out_time)
|
|
|
if check_out and now >= check_out:
|
|
|
return "elapsed"
|
|
|
if check_in and now >= check_in:
|