mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-31 18:18:27 +02:00
rtttl player (#1171)
* rtttl player * fixes * Cleanup, add action, condition, etc. * add test * updates * fixes * Add better error messages * lint
This commit is contained in:
committed by
GitHub
parent
4996967c79
commit
f6e3070dd8
@@ -22,7 +22,7 @@ void LEDCOutput::write_state(float state) {
|
||||
}
|
||||
|
||||
void LEDCOutput::setup() {
|
||||
this->apply_frequency(this->frequency_);
|
||||
this->update_frequency(this->frequency_);
|
||||
this->turn_off();
|
||||
// Attach pin after setting default value
|
||||
ledcAttachPin(this->pin_->get_pin(), this->channel_);
|
||||
@@ -50,7 +50,7 @@ optional<uint8_t> ledc_bit_depth_for_frequency(float frequency) {
|
||||
return {};
|
||||
}
|
||||
|
||||
void LEDCOutput::apply_frequency(float frequency) {
|
||||
void LEDCOutput::update_frequency(float frequency) {
|
||||
auto bit_depth_opt = ledc_bit_depth_for_frequency(frequency);
|
||||
if (!bit_depth_opt.has_value()) {
|
||||
ESP_LOGW(TAG, "Frequency %f can't be achieved with any bit depth", frequency);
|
||||
|
||||
Reference in New Issue
Block a user