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

Update mcp4461_output.h

This commit is contained in:
Oliver Kleinecke 2025-02-05 14:45:08 +01:00 committed by GitHub
parent 19893654e7
commit dfd649f603
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,12 +30,6 @@ class Mcp4461Wiper : public output::FloatOutput {
parent->disable_terminal(wiper, 'b');
if (!terminal_w && wiper_idx < 4)
parent->disable_terminal(wiper, 'w');
if (this->initial_value_.has_value()) {
// Use the value
parent->set_wiper_level(wiper, this->initial_value_);
} else {
ESP_LOGCONFIG(TAG, "No initial value set, retaining previous wiper level.");
}
}
uint16_t get_wiper_level();
void save_level();
@ -48,6 +42,7 @@ class Mcp4461Wiper : public output::FloatOutput {
void set_initial_value(float initial_value) { this->initial_value_ = initial_value; }
protected:
void setup() override;
void write_state(float state) override;
Mcp4461Component *parent_;
Mcp4461WiperIdx wiper_;