1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-24 11:38:23 +00:00

Update mcp4461_output.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-09 18:46:34 +01:00 committed by GitHub
parent 87b9f67134
commit d6c3dbe175
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,7 @@ namespace mcp4461 {
static const char *const TAG = "mcp4461.output";
void Mcp4461Wiper::write_state(float state) {
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
state = state * 1000.0;
uint16_t taps = static_cast<uint16_t>(state);
if (this->parent_->set_wiper_level_(this->wiper_, taps)( {
if (this->parent_->set_wiper_level_(this->wiper_, static_cast<uint16_t>(state * 1000))) {
this->state_ = state;
}
}