This commit is contained in:
Mateusz Gruszczyński
2026-09-01 12:07:04 +02:00
parent 6207bc4de6
commit e496f911da
25 changed files with 227 additions and 309 deletions
+1 -4
View File
@@ -1,4 +1,4 @@
pub fn refresh_control_ownership(zone: &mut Zone, house_power_enabled: bool, blocked_by_group: bool) {
pub fn refresh_control_ownership(zone: &mut Zone, house_power_enabled: bool) {
let now = Utc::now();
let (owner, source, resume_at, reason) = if !house_power_enabled {
("global_off", "global".to_string(), None, "Whole-house power is disabled".to_string())
@@ -24,9 +24,6 @@ pub fn refresh_control_ownership(zone: &mut Zone, house_power_enabled: bool, blo
"Local thermostat owns the zone".into()
};
("local_thermostat", source, resume_at, reason)
} else if blocked_by_group {
let source = if zone.control_source.starts_with("group:") { zone.control_source.clone() } else { "group".into() };
("automation", source, None, "Zone is blocked by a disabled group".to_string())
} else {
let source = if zone.control_source.starts_with("group:") { zone.control_source.clone() } else { "automation".into() };
("automation", source, zone.manual_override_until, "Automatic thermostat/schedule control".to_string())