|
|
@@ -153,7 +153,7 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
|
|
|
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:
|
|
|
+ if nxt.check_in_date is not None and nxt.check_in_time is not None:
|
|
|
check_in = datetime.combine(nxt.check_in_date, nxt.check_in_time)
|
|
|
delay = (check_in - now).total_seconds()
|
|
|
if delay > 0:
|
|
|
@@ -162,7 +162,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:
|
|
|
+ if current.check_out_date is not None and current.check_out_time is not None:
|
|
|
check_out = datetime.combine(current.check_out_date, current.check_out_time)
|
|
|
delay = (check_out - now).total_seconds()
|
|
|
if delay > 0:
|
|
|
@@ -177,9 +177,9 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
|
|
|
"""
|
|
|
now = dt_util.now().replace(tzinfo=None)
|
|
|
check_in = check_out = None
|
|
|
- if res.check_in_date and res.check_in_time:
|
|
|
+ if res.check_in_date is not None and res.check_in_time is not None:
|
|
|
check_in = datetime.combine(res.check_in_date, res.check_in_time)
|
|
|
- if res.check_out_date and res.check_out_time:
|
|
|
+ if res.check_out_date is not None and res.check_out_time is not None:
|
|
|
check_out = datetime.combine(res.check_out_date, res.check_out_time)
|
|
|
if check_out and now >= check_out:
|
|
|
return "elapsed"
|