diff --git a/appdaemon/scheduler.py b/appdaemon/scheduler.py index 6e64c51ee..82d47ce66 100644 --- a/appdaemon/scheduler.py +++ b/appdaemon/scheduler.py @@ -939,7 +939,7 @@ async def parse_datetime( async def _parse_time( self, - time_str: str, + time_str: str | datetime, name: str | None = None, today: bool = False, days_offset: int = 0 @@ -947,6 +947,9 @@ async def _parse_time( sun = None offset = 0 + if isinstance(time_str, datetime): + return time_str + timedelta(days=days_offset) + # parse time with date if match := DATE_REGEX.match(time_str): kwargs = {k: int(v) for k, v in match.groupdict().items() if v is not None}