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:
parent
87b9f67134
commit
d6c3dbe175
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user