-
Notifications
You must be signed in to change notification settings - Fork 8
Add standby option #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the fan speed control logic in the CC1101 component by introducing a conditional branch for handling speed 0, based on the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FanComponent
participant RFModule
User->>FanComponent: set_fan_speed(0)
alt map_off_to_zero_ is True
FanComponent->>RFModule: send(IthoLow)
else map_off_to_zero_ is False
FanComponent->>RFModule: send(IthoStandby)
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/cc1101/fan.cpp (1)
149-150: Improve code formatting and consider adding IthoStandby receive handling.The conditional logic correctly implements the standby functionality, but there are two improvements to consider:
- Formatting: The
elseclause should be properly formatted for consistency.- Missing receive handling: The
ITHOcheck()method doesn't handleIthoStandbycommands in its switch statement, which could cause issues if other remotes send standby commands.Formatting fix:
case 0: - if ( this->map_off_to_zero_) { rf.sendCommand(IthoLow); } - else { rf.sendCommand(IthoStandby); } + if (this->map_off_to_zero_) { + rf.sendCommand(IthoLow); + } else { + rf.sendCommand(IthoStandby); + } break;Add IthoStandby handling in ITHOcheck method:
case IthoLow: ESP_LOGD("c1101_fan", "1 / Low (or 0 / Off)"); // ... existing logic ... 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 IthoMedium:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/cc1101/README.md(1 hunks)components/cc1101/fan.cpp(1 hunks)
🔇 Additional comments (1)
components/cc1101/README.md (1)
89-89: Excellent documentation improvement.The clarifying comment helps users understand when to use
TruevsFalsefor themap_off_to_zeroconfiguration, which directly corresponds to the new standby functionality implementation.
|
Note 2 self - waiting on user to test this |
Summary by CodeRabbit
Bug Fixes
Documentation