diff --git a/esphome/components/nextion/display.py b/esphome/components/nextion/display.py index 99c8f91429..bf22f7dd5f 100644 --- a/esphome/components/nextion/display.py +++ b/esphome/components/nextion/display.py @@ -149,10 +149,6 @@ async def nextion_set_brightness_to_code(config, action_id, template_arg, args): async def to_code(config): - if CORE.is_esp32: - # Re-enable ESP-IDF's HTTP client (excluded by default to save compile time) - esp32.include_idf_component("esp_http_client") - var = cg.new_Pvariable(config[CONF_ID]) await uart.register_uart_device(var, config) @@ -181,6 +177,8 @@ async def to_code(config): cg.add_define("USE_NEXTION_TFT_UPLOAD") cg.add(var.set_tft_url(config[CONF_TFT_URL])) if CORE.is_esp32: + # Re-enable ESP-IDF's HTTP client (excluded by default to save compile time) + esp32.include_idf_component("esp_http_client") esp32.add_idf_sdkconfig_option("CONFIG_ESP_TLS_INSECURE", True) esp32.add_idf_sdkconfig_option( "CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY", True