This commit is contained in:
Mateusz Gruszczyński
2026-08-26 22:30:10 +02:00
parent 6a35096c5d
commit f8d6bc2304
21 changed files with 410 additions and 84 deletions
+28 -1
View File
@@ -244,6 +244,29 @@ impl DeviceCommand {
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ManualDeviceBaseline {
pub power: bool,
pub mode: String,
pub target_temperature: f64,
pub fan_speed: u8,
pub quiet: bool,
pub sleep: bool,
}
impl From<&Device> for ManualDeviceBaseline {
fn from(device: &Device) -> Self {
Self {
power: device.power,
mode: device.mode.clone(),
target_temperature: device.target_temperature,
fan_speed: device.fan_speed,
quiet: device.quiet,
sleep: device.sleep,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Zone {
pub id: String,
@@ -330,9 +353,13 @@ pub struct Zone {
pub device_manual_override_since: Option<DateTime<Utc>>,
#[serde(default)]
pub device_manual_override_until: Option<DateTime<Utc>>,
/// Climate-relevant fields that caused the most recent external/manual takeover.
/// Climate-relevant fields changed during the current external/manual takeover.
#[serde(default)]
pub device_manual_override_fields: Vec<String>,
/// Controller-observed climate state immediately before the takeover started.
/// It lets us drop a stale "resume automation" prompt when the user restores that state.
#[serde(default)]
pub device_manual_override_baseline: Option<ManualDeviceBaseline>,
#[serde(default)]
pub effective_mode: String,
#[serde(default)]