1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-28 21:48:16 +00:00

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-06 15:04:06 +01:00 committed by GitHub
parent 830e843a4a
commit fc6b0a8ea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -447,7 +447,11 @@ void Mcp4461Component::set_eeprom_value(Mcp4461EepromLocation location, uint16_t
addr = 1;
}
addr |= static_cast<uint8_t>(Mcp4461EepromLocation::MCP4461_EEPROM_1) + (static_cast<uint8_t>(location) * 0x10);
this->mcp4461_write_(addr, value, true);
if (this->mcp4461_write_(addr, value, true)) {
this->clear_error_state_();
} else {
this->set_error_state_();
}
}
bool Mcp4461Component::is_writing_() { return static_cast<bool>((this->get_status_register() >> 4) & 0x01); }