This commit is contained in:
Mateusz Gruszczyński
2026-09-01 14:33:45 +02:00
parent d0346dd797
commit 3c490b3064
22 changed files with 158 additions and 111 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ async fn control_zones(state: &AppState) -> Result<()> {
let schedules = state.db.list_schedules()?;
let settings = state.settings.read().await.clone();
let mut zone_snapshot = state.db.list_zones()?;
// Local/temporary thermostat ownership is independent from one-shot whole-house power
// Local/temporary thermostat ownership is independent from the legacy whole-house master gate
// commands. Expire/activate sessions on their own deadlines.
expire_local_thermostat_overrides(state, &mut zone_snapshot, &schedules, &settings.house_mode).await?;
let temporary_restored_disabled = expire_temporary_quick_thermostats(state, &mut zone_snapshot, &schedules, &settings.house_mode).await?;
@@ -189,7 +189,7 @@ async fn control_zones(state: &AppState) -> Result<()> {
zone.control_temperature_source = control_source;
zone.updated_at = Utc::now();
// A queued whole-house ON is a delayed one-shot physical action, not thermostat
// A queued whole-house ON is a delayed bulk physical action, not thermostat
// ownership. It must survive local/group/manual state while compressor protection is
// active, then execute once and hand control straight back to the existing owner.
if zone.compressor_pending_action.as_deref() == Some("global_power_on") {
@@ -216,7 +216,7 @@ async fn control_zones(state: &AppState) -> Result<()> {
}
Err(err) => {
// Keep the user-visible task and retry on a bounded deadline instead of
// spinning immediately or silently dropping a one-shot request.
// spinning immediately or silently dropping the requested global start.
zone.compressor_pending_until = Some(Utc::now() + chrono::Duration::seconds(10));
zone.lockout_until = zone.compressor_pending_until;
zone.lockout_reason = Some("global_start_retry".into());