This commit is contained in:
Mateusz Gruszczyński
2026-09-01 22:20:10 +02:00
parent 1cb62c8d0b
commit 16e0d94564
47 changed files with 2565 additions and 117 deletions
+19 -1
View File
@@ -17,6 +17,12 @@ pub struct Schedule {
pub setpoint: f64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
/// Present for records generated by the visual Flow editor. Generated records are read-only
/// in the legacy schedule/automation editors; the Flow remains the source of truth.
#[serde(default)]
pub flow_id: Option<String>,
#[serde(default)]
pub flow_node_id: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -25,7 +31,7 @@ pub struct Automation {
pub name: String,
#[serde(default = "default_true")]
pub enabled: bool,
/// temperature_above, temperature_below, time
/// temperature_above, temperature_below, time, flow
pub trigger_kind: String,
#[serde(default)]
pub trigger_device_id: Option<String>,
@@ -48,6 +54,18 @@ pub struct Automation {
pub cooldown_seconds: u64,
#[serde(default)]
pub last_fired_at: Option<DateTime<Utc>>,
/// Optional Flow-owned thermostat zone target.
#[serde(default)]
pub action_zone_id: Option<String>,
#[serde(default)]
pub action_zone_preset: Option<String>,
/// Topologically ordered condition/logic program compiled from the visual Flow graph.
#[serde(default)]
pub flow_conditions: Vec<FlowCondition>,
#[serde(default)]
pub flow_id: Option<String>,
#[serde(default)]
pub flow_node_id: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}