mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add state callback to ota component (#1816)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net> Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
		| @@ -197,6 +197,24 @@ ota: | ||||
|   port: 3286 | ||||
|   reboot_timeout: 2min | ||||
|   num_attempts: 5 | ||||
|   on_state_change: | ||||
|     then: | ||||
|       lambda: >- | ||||
|         ESP_LOGD("ota", "State %d", state); | ||||
|   on_begin: | ||||
|     then: | ||||
|       logger.log: "OTA begin" | ||||
|   on_progress: | ||||
|     then: | ||||
|       lambda: >- | ||||
|         ESP_LOGD("ota", "Got progress %f", x); | ||||
|   on_end: | ||||
|     then: | ||||
|       logger.log: "OTA end" | ||||
|   on_error: | ||||
|     then: | ||||
|       lambda: >- | ||||
|         ESP_LOGD("ota", "Got error code %d", x); | ||||
|  | ||||
| logger: | ||||
|   baud_rate: 0 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user