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 17:00:02 +01:00 committed by GitHub
parent ab85e4e28f
commit 58bff218ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -291,6 +291,10 @@ void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) {
return;
}
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) {
ESP_LOGW(TAG, "Ignoring request to increase wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx);
return;
@ -315,6 +319,10 @@ void Mcp4461Component::decrease_wiper(Mcp4461WiperIdx wiper) {
return;
}
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) {
ESP_LOGW(TAG, "Ignoring request to decrease wiper %" PRIu8 " as it is locked by WiperLock", wiper_idx);
return;