Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/cc1101/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
15 changes: 14 additions & 1 deletion components/cc1101/fan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down Expand Up @@ -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_) {
Expand Down