Fix Nextion HTTPClient error for ESP32 (#2524)

This commit is contained in:
Keith Burzinski 2021-10-15 02:26:26 -05:00 committed by GitHub
parent 1308236429
commit 7178f10bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ from esphome.const import (
CONF_BRIGHTNESS,
CONF_TRIGGER_ID,
)
from esphome.core import CORE
from . import Nextion, nextion_ns, nextion_ref
from .base_component import (
CONF_ON_SLEEP,
@ -76,6 +76,9 @@ async def to_code(config):
if CONF_TFT_URL in config:
cg.add_define("USE_NEXTION_TFT_UPLOAD")
cg.add(var.set_tft_url(config[CONF_TFT_URL]))
if CORE.is_esp32:
cg.add_library("WiFiClientSecure", None)
cg.add_library("HTTPClient", None)
if CONF_TOUCH_SLEEP_TIMEOUT in config:
cg.add(var.set_touch_sleep_timeout_internal(config[CONF_TOUCH_SLEEP_TIMEOUT]))