This commit is contained in:
Mateusz Gruszczyński committed 2026-09-23 13:41:34 +02:00
1 parent abfbf0dd68
commit aa1cb05b2f
24 files changed
+750 -71

No files matched your search

+18
View File
@@ -408,6 +408,22 @@ mod tests {
assert_eq!(monotonic_changes, 0);
}
#[test]
fn heating_curve_interpolates_and_clamps_to_endpoints() {
let config = json!({
"points": [
{"x": -20.0, "y": 30.0},
{"x": 0.0, "y": 25.0},
{"x": 20.0, "y": 19.0}
]
});
assert_eq!(flow_heating_curve_output(&config, -30.0), Some(30.0));
assert_eq!(flow_heating_curve_output(&config, 30.0), Some(19.0));
assert_eq!(flow_heating_curve_output(&config, -10.0), Some(27.5));
assert_eq!(flow_heating_curve_output(&config, 10.0), Some(22.0));
}
#[test]
fn time_automation_fires_only_once_in_the_same_minute() {
let now = Local
@@ -438,6 +454,8 @@ mod tests {
action_ha_service: None,
action_ha_entity_id: None,
action_ha_data: Value::Null,
flow_value_source_id: None,
flow_value_target: None,
flow_conditions: vec![],
flow_id: None,
flow_node_id: None,