mirror of
https://github.com/esphome/esphome.git
synced 2025-09-20 20:22:27 +01:00
Update mcp4461_output.cpp
This commit is contained in:
@@ -10,10 +10,7 @@ namespace mcp4461 {
|
|||||||
static const char *const TAG = "mcp4461.output";
|
static const char *const TAG = "mcp4461.output";
|
||||||
|
|
||||||
void Mcp4461Wiper::write_state(float state) {
|
void Mcp4461Wiper::write_state(float state) {
|
||||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
if (this->parent_->set_wiper_level_(this->wiper_, static_cast<uint16_t>(state * 1000))) {
|
||||||
state = state * 1000.0;
|
|
||||||
uint16_t taps = static_cast<uint16_t>(state);
|
|
||||||
if (this->parent_->set_wiper_level_(this->wiper_, taps)( {
|
|
||||||
this->state_ = state;
|
this->state_ = state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user