mirror of
https://github.com/esphome/esphome.git
synced 2025-03-13 22:28:14 +00:00
Update esphome/components/mcp4461/mcp4461.cpp
Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
This commit is contained in:
parent
a5e40134c5
commit
6c63f1bc8f
@ -24,7 +24,7 @@ void Mcp4461Component::begin_() {
|
||||
// save WP/WL status
|
||||
this->update_write_protection_status_();
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
if (this->reg_[i].initial_value.has_value()) {
|
||||
if (this->reg_[i].initial_value.has_value() && std::isfinite(this->reg_[i].initial_value.value())) {
|
||||
uint16_t initial_state;
|
||||
initial_state = static_cast<uint16_t>(*this->reg_[i].initial_value * 256.0f);
|
||||
this->write_wiper_level_(i, initial_state);
|
||||
|
Loading…
x
Reference in New Issue
Block a user