Skip to content

Commit

Permalink
History
Browse files Browse the repository at this point in the history
  • Loading branch information
acockburn committed Jan 23, 2023
1 parent e72796e commit 7314cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions appdaemon/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,10 @@ async def now_is_between(self, start_time_str, end_time_str, name=None):
start_time = (await self._parse_time(start_time_str, name))["datetime"]
end_time = (await self._parse_time(end_time_str, name))["datetime"]
now = (await self.get_now()).astimezone(self.AD.tz)
start_date = now.replace(hour=start_time.hour, minute=start_time.minute, second=start_time.second)
end_date = now.replace(hour=end_time.hour, minute=end_time.minute, second=end_time.second)
start_date = now.replace(
hour=start_time.hour, minute=start_time.minute, second=start_time.second, microsecond=0
)
end_date = now.replace(hour=end_time.hour, minute=end_time.minute, second=end_time.second, microsecond=0)
if end_date < start_date:
# Spans midnight
if now < start_date and now < end_date:
Expand Down
1 change: 1 addition & 0 deletions docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Change Log
- Fixed issue with setup file saying support "python3 3.0"
- Fixed issue with the inability to know which app's callback failed `constrain_state` check
- Fixed issue with AD giving messed up error messages
- Fixed an issue with scheduler.now_is_between() where it wasn;t zeroing out microseconds leading to race conditions
- Documentation fixes - contributed by `Rootie <https://github.com/Rootie>`__
- Documentation fixes - contributed by `Jakob Ruhe <https://github.com/jakeru>`__
- Documentation fixes - contributed by `illuzn <https://github.com/illuzn>`__
Expand Down

0 comments on commit 7314cb1

Please sign in to comment.