This commit is contained in:
Mateusz Gruszczyński
2026-08-28 10:04:35 +02:00
parent d159795267
commit eb325cc0c8
15 changed files with 392 additions and 653 deletions
+16
View File
@@ -38,6 +38,7 @@ fn default_night_end() -> String { "06:00".into() }
fn default_night_max_fan_speed() -> u8 { 1 }
fn default_group_power_enabled() -> bool { true }
fn default_temporary_tolerance() -> f64 { 0.3 }
fn default_temporary_start_kind() -> String { "now".into() }
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Device {
@@ -271,9 +272,18 @@ impl From<&Device> for ManualDeviceBaseline {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TemporaryQuickThermostat {
/// now | delay | at. `started_at` is the effective start instant and may be in the future.
#[serde(default = "default_temporary_start_kind")]
pub start_kind: String,
/// duration | until | temperature_reached | temperature_stable | schedule_boundary
pub finish_kind: String,
/// Effective start instant. Future values mean the temporary thermostat is scheduled
/// but does not yet own the zone or block normal schedules/automations.
pub started_at: DateTime<Utc>,
/// Set when the controller actually activates ownership. Kept separate from started_at
/// so a delayed session can survive restarts without being mistaken for an active one.
#[serde(default)]
pub activated_at: Option<DateTime<Utc>>,
/// Zone automation enabled-state from before the temporary session. A temporary
/// Quick Thermostat may run even when normal automation was disabled, then restore it.
#[serde(default)]
@@ -302,6 +312,12 @@ pub struct TemporaryQuickThermostat {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TemporaryQuickThermostatRequest {
#[serde(default = "default_temporary_start_kind")]
pub start_kind: String,
#[serde(default)]
pub start_delay_minutes: Option<u64>,
#[serde(default)]
pub start_at: Option<DateTime<Utc>>,
pub finish_kind: String,
#[serde(default)]
pub duration_minutes: Option<u64>,