diff --git a/components/cc1101/README.md b/components/cc1101/README.md index adb7cd5..06a0ad6 100644 --- a/components/cc1101/README.md +++ b/components/cc1101/README.md @@ -86,7 +86,7 @@ fan: speed_count: 3 name: "Mechanical Fan" data_pin: D1 - map_off_to_zero: True + map_off_to_zero: True # If your unit is always in low, set to True - if your unit allows turning off or standby ste to False) id: mech_fan ``` diff --git a/components/cc1101/fan.cpp b/components/cc1101/fan.cpp index b194e94..e5239a9 100644 --- a/components/cc1101/fan.cpp +++ b/components/cc1101/fan.cpp @@ -146,7 +146,11 @@ void CC1101Fan::set_fan_speed(uint8_t speed) { rf.sendCommand(IthoLow); break; case 0: - rf.sendCommand(IthoLow); + if (this->map_off_to_zero_) { + rf.sendCommand(IthoLow); + } else { + rf.sendCommand(IthoStandby); + } break; } if (timer_active_) { @@ -236,6 +240,15 @@ void CC1101Fan::ITHOcheck() { switch (cmd) { case IthoUnknown: break; + case IthoStandby: + ESP_LOGD("c1101_fan", "0 / Standby"); + if (timer_active_) { + reset_timer_.detach(); + ESP_LOGD("cc1101_fan", "Timer was active and has been canceled received remote sending standby"); + } + this->LastSpeed = this->Speed; + this->Speed = 0; + break; case IthoLow: ESP_LOGD("c1101_fan", "1 / Low (or 0 / Off)"); if (timer_active_) {