#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Schedule { pub id: String, pub zone_id: String, pub name: String, #[serde(default = "default_true")] pub enabled: bool, /// ISO weekday numbers, Monday=1, Sunday=7. pub weekdays: Vec, /// Local time HH:MM. pub start_time: String, /// Local time HH:MM. Ranges crossing midnight are supported. pub end_time: String, /// comfort/sleep/away/custom. Non-custom profiles resolve their target from the zone. #[serde(default = "default_schedule_preset")] pub preset: String, pub setpoint: f64, pub created_at: DateTime, pub updated_at: DateTime, /// 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, #[serde(default)] pub flow_node_id: Option, } #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] pub struct FlowRuntimeNodeState { #[serde(default)] pub since: Option>, #[serde(default)] pub samples: Vec, /// Last observed raw/result value for edge/change detection blocks. #[serde(default)] pub last_value: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct FlowRuntimeSample { pub at: DateTime, pub value: f64, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Automation { pub id: String, pub name: String, #[serde(default = "default_true")] pub enabled: bool, /// temperature_above, temperature_below, time, flow pub trigger_kind: String, #[serde(default)] pub trigger_device_id: Option, #[serde(default)] pub threshold: Option, #[serde(default)] pub at_time: Option, /// Legacy/direct-device target. Empty when this automation targets a group. #[serde(default)] pub action_device_id: String, /// Optional climate group target. When set, the action is applied to every member zone/device. #[serde(default)] pub action_group_id: Option, /// Optional thermostat preset used only for group actions. #[serde(default)] pub action_preset: Option, #[serde(default)] pub action: DeviceCommand, #[serde(default = "default_cooldown")] pub cooldown_seconds: u64, #[serde(default)] pub last_fired_at: Option>, /// Optional Flow-owned thermostat zone target. #[serde(default)] pub action_zone_id: Option, #[serde(default)] pub action_zone_preset: Option, #[serde(default)] pub action_ha_domain: Option, #[serde(default)] pub action_ha_service: Option, #[serde(default)] pub action_ha_entity_id: Option, #[serde(default)] pub action_ha_data: Value, /// Topologically ordered condition/logic program compiled from the visual Flow graph. #[serde(default)] pub flow_conditions: Vec, #[serde(default)] pub flow_id: Option, #[serde(default)] pub flow_node_id: Option, /// Durable state for stateful Flow blocks (timers, change detection, rate limits and rolling samples). #[serde(default)] pub flow_runtime: BTreeMap, pub created_at: DateTime, pub updated_at: DateTime, }