This commit is contained in:
Mateusz Gruszczyński committed 2026-10-11 17:02:19 +02:00
1 parent 8a7501e4ab
commit 8e8559939a
19 files changed
+144 -55

No files matched your search

+13
View File
@@ -12,6 +12,18 @@ fn device_has_thermostat_zone(device_id: &str, zones: &[Zone]) -> bool {
zones.iter().any(|zone| zone.device_id == device_id)
}
fn flow_off_physical_mode(action: &DeviceCommand) -> Option<String> {
// A thermostat Flow uses `auto` as an ownership policy (inherit house mode), not as
// the physical GREE Auto mode. Only concrete heat/cool modes are safe to persist on
// the unit while powering it off. This also clears a stale Dry/Fan mode before the
// next automated heating/cooling start.
action
.mode
.as_deref()
.filter(|mode| matches!(*mode, "heat" | "cool"))
.map(str::to_string)
}
fn flow_zone_action_already_satisfied(
zone: &Zone,
device_power: bool,
@@ -1160,6 +1172,7 @@ async fn apply_flow_zone_action(state: &AppState, zone_id: &str, preset: Option<
&device_id,
DeviceCommand {
power: Some(false),
mode: flow_off_physical_mode(action),
swing_vertical: swing_command.swing_vertical,
swing_horizontal: swing_command.swing_horizontal,
..Default::default()