mirror of
https://github.com/esphome/esphome.git
synced 2025-03-29 05:58:19 +00:00
Update mcp4461.cpp
This commit is contained in:
parent
5ef4cdde7c
commit
e41e1d3564
@ -25,6 +25,11 @@ void Mcp4461Component::begin_() {
|
|||||||
this->set_write_protection_status_();
|
this->set_write_protection_status_();
|
||||||
this->previous_write_exec_time_ = 0;
|
this->previous_write_exec_time_ = 0;
|
||||||
for (uint8_t i = 0; i < 8; i++) {
|
for (uint8_t i = 0; i < 8; i++) {
|
||||||
|
if (this->reg_[i].initial_value.has_value()) {
|
||||||
|
uint16_t initial_state;
|
||||||
|
initial_state = static_cast<uint16_t>(this->reg_[i].initial_value * 1000);
|
||||||
|
this->write_wiper_level_(i, initial_state);
|
||||||
|
}
|
||||||
if (this->reg_[i].enabled) {
|
if (this->reg_[i].enabled) {
|
||||||
this->reg_[i].state = this->read_wiper_level_(i);
|
this->reg_[i].state = this->read_wiper_level_(i);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user