mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Update mcp4461_output.cpp
This commit is contained in:
		| @@ -26,10 +26,10 @@ void Mcp4461Wiper::write_state(float state) { | ||||
| } | ||||
|  | ||||
| void Mcp4461Wiper::set_initial_value(float initial_value) { | ||||
|   if (this->initial_value_ >= 0.000 && this->initial_value_ <= 0.256) { | ||||
|       this->initial_value_ = initial_value; | ||||
|   if (initial_value >= 0.000 && initial_value <= 0.256) { | ||||
|       this->initial_value_ = static_cast<uint16_t>(initial_value * 1000); | ||||
|       // Use the value | ||||
|       ESP_LOGCONFIG(TAG, "Setting initial value %.3f", this->initial_value_); | ||||
|       ESP_LOGCONFIG(TAG, "Setting initial value %" PRIu16 "", this->initial_value_); | ||||
|       this->parent_->set_wiper_level(this->wiper_, this->initial_value_); | ||||
|     } else { | ||||
|       ESP_LOGCONFIG(TAG, "No (valid) initial value set, retaining previous wiper level."); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user