1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-01 00:18:18 +01:00

Update mcp4461_output.h

This commit is contained in:
Oliver Kleinecke 2025-02-05 14:57:02 +01:00 committed by GitHub
parent b35fa32236
commit 04734bbfe7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,6 +30,14 @@ class Mcp4461Wiper : public output::FloatOutput {
parent->disable_terminal(wiper, 'b');
if (!terminal_w && wiper_idx < 4)
parent->disable_terminal(wiper, 'w');
if (initial_value != 1.0 && initial_value >= 0.000 && initial_value <= 0.256) {
// Use the value
this->initial_value_ = initial_value;
ESP_LOGCONFIG(TAG, "Setting initial value %.3f", this->initial_value_);
this->_parent->set_wiper_level(wiper, this->initial_value_);
} else {
ESP_LOGCONFIG(TAG, "No (valid) initial value set, retaining previous wiper level.");
}
}
uint16_t get_wiper_level();
void save_level();