diff --git a/esphome/components/ota/__init__.py b/esphome/components/ota/__init__.py index 3c845490dc..3e3ac467cc 100644 --- a/esphome/components/ota/__init__.py +++ b/esphome/components/ota/__init__.py @@ -17,8 +17,13 @@ from esphome.const import ( from esphome.core import CORE, coroutine_with_priority CODEOWNERS = ["@esphome/core"] -DEPENDENCIES = ["network"] -AUTO_LOAD = ["socket", "md5"] + + +def AUTO_LOAD(): + if CORE.using_zephyr: + return ["ota_mcuboot"] + return ["ota_network"] + CONF_ON_STATE_CHANGE = "on_state_change" CONF_ON_BEGIN = "on_begin" @@ -90,7 +95,7 @@ async def to_code(config): CORE.data[CONF_OTA] = {} var = cg.new_Pvariable(config[CONF_ID]) - cg.add(var.set_port(config[CONF_PORT])) + # cg.add(var.set_port(config[CONF_PORT])) cg.add_define("USE_OTA") if CONF_PASSWORD in config: cg.add(var.set_auth_password(config[CONF_PASSWORD])) diff --git a/esphome/components/ota_mcuboot/__init__.py b/esphome/components/ota_mcuboot/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/esphome/components/ota_network/__init__.py b/esphome/components/ota_network/__init__.py new file mode 100644 index 0000000000..0b3d6f29be --- /dev/null +++ b/esphome/components/ota_network/__init__.py @@ -0,0 +1,3 @@ +CODEOWNERS = ["@esphome/core"] +DEPENDENCIES = ["network"] +AUTO_LOAD = ["socket", "md5"] diff --git a/esphome/components/ota/automation.h b/esphome/components/ota_network/automation.h similarity index 100% rename from esphome/components/ota/automation.h rename to esphome/components/ota_network/automation.h diff --git a/esphome/components/ota/ota_backend.h b/esphome/components/ota_network/ota_backend.h similarity index 100% rename from esphome/components/ota/ota_backend.h rename to esphome/components/ota_network/ota_backend.h diff --git a/esphome/components/ota/ota_backend_arduino_esp32.cpp b/esphome/components/ota_network/ota_backend_arduino_esp32.cpp similarity index 100% rename from esphome/components/ota/ota_backend_arduino_esp32.cpp rename to esphome/components/ota_network/ota_backend_arduino_esp32.cpp diff --git a/esphome/components/ota/ota_backend_arduino_esp32.h b/esphome/components/ota_network/ota_backend_arduino_esp32.h similarity index 100% rename from esphome/components/ota/ota_backend_arduino_esp32.h rename to esphome/components/ota_network/ota_backend_arduino_esp32.h diff --git a/esphome/components/ota/ota_backend_arduino_esp8266.cpp b/esphome/components/ota_network/ota_backend_arduino_esp8266.cpp similarity index 100% rename from esphome/components/ota/ota_backend_arduino_esp8266.cpp rename to esphome/components/ota_network/ota_backend_arduino_esp8266.cpp diff --git a/esphome/components/ota/ota_backend_arduino_esp8266.h b/esphome/components/ota_network/ota_backend_arduino_esp8266.h similarity index 100% rename from esphome/components/ota/ota_backend_arduino_esp8266.h rename to esphome/components/ota_network/ota_backend_arduino_esp8266.h diff --git a/esphome/components/ota/ota_backend_arduino_libretiny.cpp b/esphome/components/ota_network/ota_backend_arduino_libretiny.cpp similarity index 100% rename from esphome/components/ota/ota_backend_arduino_libretiny.cpp rename to esphome/components/ota_network/ota_backend_arduino_libretiny.cpp diff --git a/esphome/components/ota/ota_backend_arduino_libretiny.h b/esphome/components/ota_network/ota_backend_arduino_libretiny.h similarity index 100% rename from esphome/components/ota/ota_backend_arduino_libretiny.h rename to esphome/components/ota_network/ota_backend_arduino_libretiny.h diff --git a/esphome/components/ota/ota_backend_arduino_rp2040.cpp b/esphome/components/ota_network/ota_backend_arduino_rp2040.cpp similarity index 100% rename from esphome/components/ota/ota_backend_arduino_rp2040.cpp rename to esphome/components/ota_network/ota_backend_arduino_rp2040.cpp diff --git a/esphome/components/ota/ota_backend_arduino_rp2040.h b/esphome/components/ota_network/ota_backend_arduino_rp2040.h similarity index 100% rename from esphome/components/ota/ota_backend_arduino_rp2040.h rename to esphome/components/ota_network/ota_backend_arduino_rp2040.h diff --git a/esphome/components/ota/ota_backend_esp_idf.cpp b/esphome/components/ota_network/ota_backend_esp_idf.cpp similarity index 100% rename from esphome/components/ota/ota_backend_esp_idf.cpp rename to esphome/components/ota_network/ota_backend_esp_idf.cpp diff --git a/esphome/components/ota/ota_backend_esp_idf.h b/esphome/components/ota_network/ota_backend_esp_idf.h similarity index 100% rename from esphome/components/ota/ota_backend_esp_idf.h rename to esphome/components/ota_network/ota_backend_esp_idf.h diff --git a/esphome/components/ota/ota_component.cpp b/esphome/components/ota_network/ota_component.cpp similarity index 100% rename from esphome/components/ota/ota_component.cpp rename to esphome/components/ota_network/ota_component.cpp diff --git a/esphome/components/ota/ota_component.h b/esphome/components/ota_network/ota_component.h similarity index 100% rename from esphome/components/ota/ota_component.h rename to esphome/components/ota_network/ota_component.h