1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

fix: update state conversion range in MCP4461 wiper to 0 - 256

This commit is contained in:
Oliver Kleinecke
2025-02-16 13:42:46 +01:00
parent 5e5e7c1714
commit 3beefc1e4b

View File

@@ -10,7 +10,7 @@ namespace mcp4461 {
static const char *const TAG = "mcp4461.output";
// floats from other components (like light etc.) are passed as "percentage floats"
// this function converts them to the 0.0 - 0.256 range used by the MCP4461
// this function converts them to the 0 - 256 range used by the MCP4461
void Mcp4461Wiper::write_state(float state) {
if (this->parent_->set_wiper_level_(this->wiper_, static_cast<uint16_t>(state * 256))) {
this->state_ = state;