Disable fan auto mode by default for Thermostat v2.2

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2023-02-07 12:04:59 +08:00
parent 069e178966
commit 83d5c28a67

View File

@ -54,7 +54,9 @@ impl FanCtrl {
FanCtrl {
fan,
available,
fan_auto: true,
// do not enable auto mode by default,
// but allow to turn it on on customer's own risk
fan_auto: hwrev.fan_auto_mode_available(),
k_a: DEFAULT_K_A,
k_b: DEFAULT_K_B,
k_c: DEFAULT_K_C,
@ -142,6 +144,12 @@ impl HWRev {
pub fn fan_available(&self) -> bool {
self.major == 2 && self.minor == 2
}
pub fn fan_auto_mode_available(&self) -> bool {
// see https://github.com/sinara-hw/Thermostat/issues/115 and
// https://git.m-labs.hk/M-Labs/thermostat/issues/69#issuecomment-6464 for explanation
self.fan_available() && self.minor != 2
}
}
#[derive(Serialize)]