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
Add RTTTL volume control. #5968
Conversation
Hey there @glmnet, mind taking a look at this pull request as it has been labeled with an integration ( |
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.
I have not tested this yet, but should this be a config option like volume between 0-10 etc that maps to bigger values?
Yes, but i need to figure out what the high and low values should be. |
True...haha |
Could this be like a Something like: rtttl:
output: rtttl_out
id: my_rtttl
gain: 2 Or: rtttl:
output: rtttl_out
id: my_rtttl
gain: 0.5 So you multiply 8192 by the gain, which will be float, with My point is more that naming |
I think this is the way to go. |
Okay @edwardtfn, @jesserockz i have added the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #5968 +/- ##
==========================================
+ Coverage 53.70% 53.81% +0.10%
==========================================
Files 50 50
Lines 9408 9438 +30
Branches 1654 1660 +6
==========================================
+ Hits 5053 5079 +26
+ Misses 4056 4052 -4
- Partials 299 307 +8 ☔ View full report in Codecov by Sentry. |
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.
A couple of things below, and also can you please update the PR title and description and also add a docs PR for the new config?
Cheers
Jesse
esphome/components/rtttl/rtttl.cpp
Outdated
@@ -254,7 +254,7 @@ void Rtttl::loop() { | |||
// Add small silence gap between same note | |||
this->output_freq_ = freq; | |||
|
|||
ESP_LOGVV(TAG, "playing note: %d for %dms", note, this->note_duration_); | |||
ESP_LOGI(TAG, "playing note: %d for %dms", note, this->note_duration_); |
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.
Should this log level be reverted?
Thanks for the review @jesserockz. i resolved the issues you reported |
I have updated the documentation now. |
What does this implement/fix?
Add Gain option to set the volume.
Types of changes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3644
Test Environment
Example