diff --git a/src/HABApp/__version__.py b/src/HABApp/__version__.py index 528144c3..8d251b60 100644 --- a/src/HABApp/__version__.py +++ b/src/HABApp/__version__.py @@ -10,4 +10,4 @@ # Development versions contain the DEV-COUNTER postfix: # - 24.01.0.DEV-1 -__version__ = '24.09.0.DEV-3' +__version__ = '24.09.0.DEV-4' diff --git a/src/HABApp/rule/interfaces/http_interface.py b/src/HABApp/rule/interfaces/http_interface.py index e69de29b..c34369be 100644 --- a/src/HABApp/rule/interfaces/http_interface.py +++ b/src/HABApp/rule/interfaces/http_interface.py @@ -0,0 +1 @@ +from HABApp.rule.interfaces._http import delete, get, get_client_session, post, put diff --git a/src/HABApp/rule/scheduler/job_builder.py b/src/HABApp/rule/scheduler/job_builder.py index 7ba3aafc..7548eef6 100644 --- a/src/HABApp/rule/scheduler/job_builder.py +++ b/src/HABApp/rule/scheduler/job_builder.py @@ -3,6 +3,7 @@ import random import warnings from collections.abc import Callable, Hashable, Iterable, Mapping +from datetime import datetime as dt_datetime from typing import TYPE_CHECKING, Any, Final, TypeAlias from eascheduler.builder import FilterBuilder, JobBuilder, TriggerBuilder @@ -179,6 +180,10 @@ def on_day_of_week(self, time, weekdays, 'self.run.on_day_of_week is deprecated. Use self.run.at in combination with a trigger and a filter', DeprecationWarning, stacklevel=2 ) + + if isinstance(time, dt_datetime): + time = time.time() + return self.at( TriggerBuilder.time(time).only_at(FilterBuilder.weekdays(weekdays)), callback, *args, **kwargs @@ -190,6 +195,10 @@ def on_every_day(self, time, callback: HINT_CB, 'self.run.on_every_day is deprecated. Use self.run.at in combination with a trigger', DeprecationWarning, stacklevel=2 ) + + if isinstance(time, dt_datetime): + time = time.time() + return self.at( TriggerBuilder.time(time), callback, *args, **kwargs