Fix Nextion HTTPClient error for ESP32 (#2524)

This commit is contained in:
Keith Burzinski 2021-10-15 02:26:26 -05:00 committed by Jesse Hills
parent 15b5ea43a7
commit c3a8a044b9
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

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