mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	fix servo warning (#1591)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							c17624adab
						
					
				
				
					commit
					2b60b0f1fa
				
			| @@ -31,7 +31,7 @@ void Servo::loop() { | ||||
|     if (this->transition_length_) { | ||||
|       float new_value; | ||||
|       float travel_diff = this->target_value_ - this->source_value_; | ||||
|       uint32_t target_runtime = target_runtime = abs((int) ((travel_diff) * this->transition_length_ * 1.0f / 2.0f)); | ||||
|       uint32_t target_runtime = abs((int) ((travel_diff) * this->transition_length_ * 1.0f / 2.0f)); | ||||
|       uint32_t current_runtime = millis() - this->start_millis_; | ||||
|       float percentage_run = current_runtime * 1.0f / target_runtime * 1.0f; | ||||
|       if (percentage_run > 1.0f) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user