work: добавил автоматический режим

This commit is contained in:
Fedorov Dmitriy
2026-09-18 23:59:42 +03:00
parent 7dbfd8b069
commit cdec9b0996
24 changed files with 3449 additions and 33 deletions
+20 -5
View File
@@ -208,16 +208,32 @@ def _parse_action(
if action_type == ScheduleActionType.AUTO:
extra = set(data) - {"type"}
extra = set(data) - {
"type",
"speed",
}
if extra:
raise ValueError(
"AUTO action cannot contain "
f"SET fields: {sorted(extra)}"
"AUTO action supports only "
f"'speed': {sorted(extra)}"
)
if "speed" not in data:
raise ValueError(
"AUTO action must contain "
"fallback speed"
)
settings = _parse_settings(
{
"speed": data["speed"],
}
)
return ScheduleAction(
type=ScheduleActionType.AUTO
type=ScheduleActionType.AUTO,
settings=settings,
)
settings_data = {
@@ -233,7 +249,6 @@ def _parse_action(
),
)
def _parse_template(
name: str,
data: Any,