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

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke
2025-02-06 17:00:02 +01:00
committed by GitHub
parent ab85e4e28f
commit 58bff218ff

View File

@@ -291,6 +291,10 @@ void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) {
return; return;
} }
uint8_t wiper_idx = static_cast<uint8_t>(wiper); uint8_t wiper_idx = static_cast<uint8_t>(wiper);
if (!(this->reg_[wiper_idx].enabled)) {
ESP_LOGW(TAG, "increasing disabled volatile wiper %" PRIu8 " is prohibited", wiper_idx);
return;
}
if (this->reg_[wiper_idx].wiper_lock_active) { if (this->reg_[wiper_idx].wiper_lock_active) {
ESP_LOGW(TAG, "Ignoring request to increase wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx); ESP_LOGW(TAG, "Ignoring request to increase wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx);
return; return;
@@ -315,6 +319,10 @@ void Mcp4461Component::decrease_wiper(Mcp4461WiperIdx wiper) {
return; return;
} }
uint8_t wiper_idx = static_cast<uint8_t>(wiper); uint8_t wiper_idx = static_cast<uint8_t>(wiper);
if (!(this->reg_[wiper_idx].enabled)) {
ESP_LOGW(TAG, "decreasing disabled volatile wiper %" PRIu8 " is prohibited", wiper_idx);
return;
}
if (this->reg_[wiper_idx].wiper_lock_active) { if (this->reg_[wiper_idx].wiper_lock_active) {
ESP_LOGW(TAG, "Ignoring request to decrease wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx); ESP_LOGW(TAG, "Ignoring request to decrease wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx);
return; return;