1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-28 21:48:16 +00:00

Update mcp4461_output.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-06 18:28:11 +01:00 committed by GitHub
parent 604eaa80af
commit 7ca80bf008
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,8 +96,9 @@ void Mcp4461Wiper::increase_wiper() {
ESP_LOGW(TAG, "Cannot increase nonvolatile wiper %" PRIu8 " !", wiper_idx);
return;
}
this->state_ = this->state_ + 1.0;
this->parent_->increase_wiper(this->wiper_);
if (this->parent_->increase_wiper(this->wiper_)) {
this->state_ = this->state_ + 1.0;
}
}
void Mcp4461Wiper::decrease_wiper() {
@ -110,8 +111,9 @@ void Mcp4461Wiper::decrease_wiper() {
ESP_LOGW(TAG, "Cannot decrease nonvolatile wiper %" PRIu8 " !", wiper_idx);
return;
}
this->state_ = this->state_ - 1.0;
this->parent_->decrease_wiper(this->wiper_);
if (this->parent_->decrease_wiper(this->wiper_)) {
this->state_ = this->state_ - 1.0;
}
}
void Mcp4461Wiper::enable_terminal(char terminal) {