mirror of
https://github.com/esphome/esphome.git
synced 2025-04-01 00:18:18 +01:00
Update mcp4461.cpp
This commit is contained in:
parent
1d138e5607
commit
0524e0b96f
@ -167,6 +167,10 @@ void Mcp4461Component::set_wiper_level(Mcp4461WiperIdx wiper, uint16_t value) {
|
||||
ESP_LOGW(TAG, "ignoring invalid wiper level %" PRIu16 "!");
|
||||
return;
|
||||
}
|
||||
if (!(this->reg_[wiper_idx].enabled)) {
|
||||
ESP_LOGW(TAG, "writing to disabled volatile wiper %" PRIu8 " is prohibited", wiper_idx);
|
||||
return static_cast<uint16_t>(0);
|
||||
}
|
||||
ESP_LOGV(TAG, "Setting MCP4461 wiper %" PRIu8 " to %" PRIu16 "!", wiper_idx, value);
|
||||
this->reg_[wiper_idx].state = value;
|
||||
this->update_ = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user