feat: v.1.2.0 добавлин web интерфейс.

This commit is contained in:
Fedorov Dmitriy
2026-09-20 02:00:28 +03:00
parent 3cd71ba5ff
commit 8f749da14c
4 changed files with 155 additions and 15 deletions
+22 -1
View File
@@ -105,6 +105,27 @@ class ScheduleService:
def config(self) -> ScheduleConfig:
return self._config
async def replace_config(
self,
config: ScheduleConfig,
) -> None:
"""Заменить расписание без перезапуска приложения."""
if not isinstance(config, ScheduleConfig):
raise TypeError("config must be ScheduleConfig")
self._config = config
self._last_applied_when = None
self._clear_override()
self._last_error = None
# Сохранение расписания не должно завершаться ошибкой только из-за
# временно недоступного Bluetooth. Фоновый цикл повторит применение.
if self._running and not self._paused:
try:
await self._process()
except Exception as exc:
self._last_error = f"{type(exc).__name__}: {exc}"
def _load_runtime_state(self) -> None:
if self._state_path is None:
@@ -626,4 +647,4 @@ class ScheduleService:
if settings.power is False:
await self._tion.execute(
lambda tion: tion.power_off()
)
)