1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-12 22:00:30 +01:00

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-09 12:15:28 +01:00 committed by GitHub
parent 01cc629193
commit d2ba3eef3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -334,6 +334,7 @@ void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) {
ESP_LOGE(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(this->error_code_)));
return;
}
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
if (!(this->reg_[wiper_idx].enabled)) {
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_DISABLED)));
return;
@ -342,7 +343,6 @@ void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) {
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_LOCKED)));
return;
}
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
ESP_LOGV(TAG, "Disabling wiper %" PRIu8, wiper_idx);
this->reg_[wiper_idx].terminal_hw = false;
this->update_ = true;