v0.9.2
This commit is contained in:
1 parent
dc20267787
commit
97c26c67b6
10 files changed
+67
-46
No files matched your search
@@ -439,6 +439,27 @@ mod tests {
|
||||
assert_eq!(effective_zone_mode(&zone, "off"), "cool");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn indefinite_local_off_does_not_create_or_rearm_handback() {
|
||||
let mut zone = test_zone("device");
|
||||
zone.local_thermostat_power = Some(false);
|
||||
zone.local_thermostat_resume_at = None;
|
||||
assert!(!local_thermostat_handback_is_active(&zone));
|
||||
assert!(!rearm_local_thermostat_resume(&mut zone, Utc::now()));
|
||||
assert_eq!(zone.local_thermostat_power, Some(false));
|
||||
assert!(zone.local_thermostat_resume_at.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn timed_local_off_remains_blocking_until_explicit_deadline() {
|
||||
let mut zone = test_zone("device");
|
||||
let now = Utc::now();
|
||||
set_local_thermostat_power(&mut zone, false, now);
|
||||
assert!(local_thermostat_handback_is_active(&zone));
|
||||
assert_eq!(zone.local_thermostat_power, Some(false));
|
||||
assert!(zone.local_thermostat_resume_at.is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn local_thermostat_off_restarts_backend_handback_deadline() {
|
||||
let mut zone = test_zone("device");
|
||||
|
||||
Reference in new issue
Block a user