v0.15.19
This commit is contained in:
1 parent
3b71b057cd
commit
abfbf0dd68
5 files changed
+10
-34
No files matched your search
@@ -909,14 +909,6 @@ fn flow_condition_kind_runtime(kind: &str) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
fn apply_flow_zone_power_enabled_state(zone: &mut Zone, power: Option<bool>) {
|
||||
// OFF controls the thermostat/unit runtime only. It must not disable the administrative Zone.
|
||||
// Keep the historical ON recovery so installations affected by the old OFF behavior can heal.
|
||||
if power == Some(true) {
|
||||
zone.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
async fn apply_flow_zone_action(state: &AppState, zone_id: &str, preset: Option<&str>, action: &DeviceCommand) -> Result<bool, AppError> {
|
||||
let _schedule_guard = state.lock_schedule_operation().await;
|
||||
// Match the canonical thermostat ordering used by Web/HA zone control. This prevents
|
||||
@@ -925,14 +917,10 @@ async fn apply_flow_zone_action(state: &AppState, zone_id: &str, preset: Option<
|
||||
let _zone_guard = state.lock_zone_operation(zone_id).await;
|
||||
let Some(mut zone) = state.db.get_zone(zone_id)? else { return Err(AppError::NotFound(format!("zone {zone_id}"))); };
|
||||
if zone.device_manual_override || zone.local_thermostat_power.is_some() || temporary_quick_thermostat_is_active(&zone, Utc::now()) { return Ok(false); }
|
||||
// Match the existing automatic-device ownership semantics: a disabled thermostat zone
|
||||
// remains an explicit gate unless this Flow action is the actor re-enabling it.
|
||||
if !zone.enabled && action.power != Some(true) { return Ok(false); }
|
||||
// A disabled Zone is an administrative gate for every Flow thermostat action.
|
||||
// Flow power commands control only the assigned unit runtime; they never change zone.enabled.
|
||||
if !zone.enabled { return Ok(false); }
|
||||
let device_id = zone.device_id.clone();
|
||||
// Flow thermostat OFF is a runtime climate command, not the persistent administrative
|
||||
// Zone enabled/disabled switch. Keep the zone enabled so later Flow/schedule evaluation can
|
||||
// continue normally.
|
||||
apply_flow_zone_power_enabled_state(&mut zone, action.power);
|
||||
if let Some(mode) = action.mode.as_deref() {
|
||||
match mode { "auto" => zone.inherit_house_mode = true, "heat" | "cool" => { zone.mode = mode.to_string(); zone.inherit_house_mode = false; }, _ => return Err(AppError::BadRequest("unsupported Flow thermostat mode".into())) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user