mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	move more
This commit is contained in:
		| @@ -1,7 +1,6 @@ | |||||||
| from esphome import automation | from esphome import automation | ||||||
| import esphome.codegen as cg | import esphome.codegen as cg | ||||||
| from esphome.components.ota import BASE_OTA_SCHEMA, ota_to_code | from esphome.components.ota import BASE_OTA_SCHEMA, ota_to_code | ||||||
| from esphome.components.ota_base import OTAComponent |  | ||||||
| import esphome.config_validation as cv | import esphome.config_validation as cv | ||||||
| from esphome.const import CONF_ID, CONF_PASSWORD, CONF_URL, CONF_USERNAME | from esphome.const import CONF_ID, CONF_PASSWORD, CONF_URL, CONF_USERNAME | ||||||
| from esphome.core import coroutine_with_priority | from esphome.core import coroutine_with_priority | ||||||
| @@ -16,6 +15,9 @@ DEPENDENCIES = ["network", "http_request"] | |||||||
| CONF_MD5 = "md5" | CONF_MD5 = "md5" | ||||||
| CONF_MD5_URL = "md5_url" | CONF_MD5_URL = "md5_url" | ||||||
|  |  | ||||||
|  | ota_base_ns = cg.esphome_ns.namespace("ota_base") | ||||||
|  | OTAComponent = ota_base_ns.class_("OTAComponent", cg.Component) | ||||||
|  |  | ||||||
| OtaHttpRequestComponent = http_request_ns.class_( | OtaHttpRequestComponent = http_request_ns.class_( | ||||||
|     "OtaHttpRequestComponent", OTAComponent |     "OtaHttpRequestComponent", OTAComponent | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| from esphome import automation | from esphome import automation | ||||||
| import esphome.codegen as cg | import esphome.codegen as cg | ||||||
| from esphome.components.ota_base import OTAState |  | ||||||
| import esphome.config_validation as cv | import esphome.config_validation as cv | ||||||
| from esphome.const import ( | from esphome.const import ( | ||||||
|     CONF_ESPHOME, |     CONF_ESPHOME, | ||||||
| @@ -11,6 +10,8 @@ from esphome.const import ( | |||||||
| ) | ) | ||||||
| from esphome.core import coroutine_with_priority | from esphome.core import coroutine_with_priority | ||||||
|  |  | ||||||
|  | from ..ota_base import OTAState | ||||||
|  |  | ||||||
| CODEOWNERS = ["@esphome/core"] | CODEOWNERS = ["@esphome/core"] | ||||||
| AUTO_LOAD = ["safe_mode", "ota_base"] | AUTO_LOAD = ["safe_mode", "ota_base"] | ||||||
|  |  | ||||||
| @@ -24,7 +25,6 @@ CONF_ON_STATE_CHANGE = "on_state_change" | |||||||
|  |  | ||||||
|  |  | ||||||
| ota_ns = cg.esphome_ns.namespace("ota") | ota_ns = cg.esphome_ns.namespace("ota") | ||||||
| # OTAComponent and OTAState are imported from ota_base |  | ||||||
| OTAAbortTrigger = ota_ns.class_("OTAAbortTrigger", automation.Trigger.template()) | OTAAbortTrigger = ota_ns.class_("OTAAbortTrigger", automation.Trigger.template()) | ||||||
| OTAEndTrigger = ota_ns.class_("OTAEndTrigger", automation.Trigger.template()) | OTAEndTrigger = ota_ns.class_("OTAEndTrigger", automation.Trigger.template()) | ||||||
| OTAErrorTrigger = ota_ns.class_("OTAErrorTrigger", automation.Trigger.template()) | OTAErrorTrigger = ota_ns.class_("OTAErrorTrigger", automation.Trigger.template()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user