1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke
2025-02-09 18:58:26 +01:00
committed by GitHub
parent 0c7b644f26
commit f897295db5

View File

@@ -366,6 +366,10 @@ bool Mcp4461Component::increase_wiper_(Mcp4461WiperIdx wiper) {
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string(MCP4461_WIPER_LOCKED)));
return false;
}
if (this->reg_[wiper_idx].state == 256) {
ESP_LOGV(TAG, "%s", "Maximum wiper level reached, further increase of wiper %" PRIu8 " prohibited", wiper_idx);
return false;
}
ESP_LOGV(TAG, "Increasing wiper %" PRIu8 "", wiper_idx);
uint8_t reg = 0;
uint8_t addr;
@@ -396,6 +400,10 @@ bool Mcp4461Component::decrease_wiper_(Mcp4461WiperIdx wiper) {
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string(MCP4461_WIPER_LOCKED)));
return false;
}
if (this->reg_[wiper_idx].state == 0) {
ESP_LOGV(TAG, "%s", "Minimum wiper level reached, further decrease of wiper %" PRIu8 " prohibited", wiper_idx);
return false;
}
ESP_LOGV(TAG, "Decreasing wiper %" PRIu8 "", wiper_idx);
uint8_t reg = 0;
uint8_t addr;