mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Template Cover don't auto-set current_operation (#612)
Fixes https://github.com/esphome/issues/issues/408
This commit is contained in:
		| @@ -74,19 +74,12 @@ void TemplateCover::control(const CoverCall &call) { | |||||||
|     this->stop_prev_trigger_(); |     this->stop_prev_trigger_(); | ||||||
|     this->stop_trigger_->trigger(); |     this->stop_trigger_->trigger(); | ||||||
|     this->prev_command_trigger_ = this->stop_trigger_; |     this->prev_command_trigger_ = this->stop_trigger_; | ||||||
|     this->current_operation = COVER_OPERATION_IDLE; |  | ||||||
|     this->publish_state(); |     this->publish_state(); | ||||||
|   } |   } | ||||||
|   if (call.get_position().has_value()) { |   if (call.get_position().has_value()) { | ||||||
|     auto pos = *call.get_position(); |     auto pos = *call.get_position(); | ||||||
|     this->stop_prev_trigger_(); |     this->stop_prev_trigger_(); | ||||||
|  |  | ||||||
|     if (pos < this->position) { |  | ||||||
|       this->current_operation = COVER_OPERATION_CLOSING; |  | ||||||
|     } else if (pos > this->position) { |  | ||||||
|       this->current_operation = COVER_OPERATION_OPENING; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (pos == COVER_OPEN) { |     if (pos == COVER_OPEN) { | ||||||
|       this->open_trigger_->trigger(); |       this->open_trigger_->trigger(); | ||||||
|       this->prev_command_trigger_ = this->open_trigger_; |       this->prev_command_trigger_ = this->open_trigger_; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user