Disable dependency finder on ESP32 (#2435)

This commit is contained in:
Stefan Agner 2021-10-03 21:53:40 +02:00 committed by GitHub
parent cee08debff
commit 1627dff166
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 35 additions and 6 deletions

View file

@ -1,6 +1,7 @@
import esphome.codegen as cg import esphome.codegen as cg
import esphome.config_validation as cv import esphome.config_validation as cv
from esphome.components import sensor, ble_client from esphome.components import sensor, ble_client
from esphome.core import CORE
from esphome.const import ( from esphome.const import (
DEVICE_CLASS_CARBON_DIOXIDE, DEVICE_CLASS_CARBON_DIOXIDE,
@ -116,3 +117,6 @@ async def to_code(config):
if CONF_TVOC in config: if CONF_TVOC in config:
sens = await sensor.new_sensor(config[CONF_TVOC]) sens = await sensor.new_sensor(config[CONF_TVOC])
cg.add(var.set_tvoc(sens)) cg.add(var.set_tvoc(sens))
if CORE.is_esp32:
cg.add_library("ESP32 BLE Arduino", None)

View file

@ -3,7 +3,7 @@ import esphome.config_validation as cv
from esphome.components import web_server_base from esphome.components import web_server_base
from esphome.components.web_server_base import CONF_WEB_SERVER_BASE_ID from esphome.components.web_server_base import CONF_WEB_SERVER_BASE_ID
from esphome.const import CONF_ID from esphome.const import CONF_ID
from esphome.core import coroutine_with_priority from esphome.core import coroutine_with_priority, CORE
AUTO_LOAD = ["web_server_base"] AUTO_LOAD = ["web_server_base"]
DEPENDENCIES = ["wifi"] DEPENDENCIES = ["wifi"]
@ -32,3 +32,7 @@ async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID], paren) var = cg.new_Pvariable(config[CONF_ID], paren)
await cg.register_component(var, config) await cg.register_component(var, config)
cg.add_define("USE_CAPTIVE_PORTAL") cg.add_define("USE_CAPTIVE_PORTAL")
if CORE.is_esp32:
cg.add_library("DNSServer", None)
cg.add_library("WiFi", None)

View file

@ -276,6 +276,8 @@ async def to_code(config):
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD]) cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
cg.add_build_flag(f"-DUSE_ESP32_VARIANT_{config[CONF_VARIANT]}") cg.add_build_flag(f"-DUSE_ESP32_VARIANT_{config[CONF_VARIANT]}")
cg.add_platformio_option("lib_ldf_mode", "off")
conf = config[CONF_FRAMEWORK] conf = config[CONF_FRAMEWORK]
if conf[CONF_TYPE] == FRAMEWORK_ESP_IDF: if conf[CONF_TYPE] == FRAMEWORK_ESP_IDF:
cg.add_platformio_option( cg.add_platformio_option(

View file

@ -123,3 +123,6 @@ async def to_code(config):
cg.add(var.set_manual_ip(manual_ip(config[CONF_MANUAL_IP]))) cg.add(var.set_manual_ip(manual_ip(config[CONF_MANUAL_IP])))
cg.add_define("USE_ETHERNET") cg.add_define("USE_ETHERNET")
if CORE.is_esp32:
cg.add_library("WiFi", None)

View file

@ -92,6 +92,11 @@ async def to_code(config):
cg.add(var.set_useragent(config[CONF_USERAGENT])) cg.add(var.set_useragent(config[CONF_USERAGENT]))
if CORE.is_esp8266 and not config[CONF_ESP8266_DISABLE_SSL_SUPPORT]: if CORE.is_esp8266 and not config[CONF_ESP8266_DISABLE_SSL_SUPPORT]:
cg.add_define("USE_HTTP_REQUEST_ESP8266_HTTPS") cg.add_define("USE_HTTP_REQUEST_ESP8266_HTTPS")
if CORE.is_esp32:
cg.add_library("WiFiClientSecure", None)
cg.add_library("HTTPClient", None)
await cg.register_component(var, config) await cg.register_component(var, config)

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv import esphome.config_validation as cv
from esphome.components import spi from esphome.components import spi
from esphome.const import CONF_ID from esphome.const import CONF_ID
from esphome.core import CORE
DEPENDENCIES = ["spi"] DEPENDENCIES = ["spi"]
AUTO_LOAD = ["sensor"] AUTO_LOAD = ["sensor"]
@ -23,3 +24,6 @@ async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config) await cg.register_component(var, config)
await spi.register_spi_device(var, config) await spi.register_spi_device(var, config)
if CORE.is_esp32:
cg.add_library("SPI", None)

View file

@ -30,15 +30,16 @@ CONFIG_SCHEMA = cv.All(
async def to_code(config): async def to_code(config):
if config[CONF_DISABLED]:
return
cg.add_define("USE_MDNS")
if CORE.using_arduino: if CORE.using_arduino:
if CORE.is_esp32: if CORE.is_esp32:
cg.add_library("ESPmDNS", None) cg.add_library("ESPmDNS", None)
elif CORE.is_esp8266: elif CORE.is_esp8266:
cg.add_library("ESP8266mDNS", None) cg.add_library("ESP8266mDNS", None)
if config[CONF_DISABLED]:
return
cg.add_define("USE_MDNS")
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config) await cg.register_component(var, config)

View file

@ -101,6 +101,7 @@ async def to_code(config):
if CORE.is_esp8266: if CORE.is_esp8266:
cg.add_library("Update", None) cg.add_library("Update", None)
elif CORE.is_esp32 and CORE.using_arduino: elif CORE.is_esp32 and CORE.using_arduino:
cg.add_library("Update", None)
cg.add_library("Hash", None) cg.add_library("Hash", None)
use_state_callback = False use_state_callback = False

View file

@ -10,7 +10,7 @@ from esphome.const import (
CONF_SPI_ID, CONF_SPI_ID,
CONF_CS_PIN, CONF_CS_PIN,
) )
from esphome.core import coroutine_with_priority from esphome.core import coroutine_with_priority, CORE
CODEOWNERS = ["@esphome/core"] CODEOWNERS = ["@esphome/core"]
spi_ns = cg.esphome_ns.namespace("spi") spi_ns = cg.esphome_ns.namespace("spi")
@ -46,6 +46,9 @@ async def to_code(config):
mosi = await cg.gpio_pin_expression(config[CONF_MOSI_PIN]) mosi = await cg.gpio_pin_expression(config[CONF_MOSI_PIN])
cg.add(var.set_mosi(mosi)) cg.add(var.set_mosi(mosi))
if CORE.is_esp32:
cg.add_library("SPI", None)
def spi_device_schema(cs_pin_required=True): def spi_device_schema(cs_pin_required=True):
"""Create a schema for an SPI device. """Create a schema for an SPI device.

View file

@ -24,6 +24,8 @@ async def to_code(config):
await cg.register_component(var, config) await cg.register_component(var, config)
if CORE.is_esp32: if CORE.is_esp32:
cg.add_library("WiFi", None)
cg.add_library("FS", None) cg.add_library("FS", None)
cg.add_library("Update", None)
# https://github.com/esphome/ESPAsyncWebServer/blob/master/library.json # https://github.com/esphome/ESPAsyncWebServer/blob/master/library.json
cg.add_library("esphome/ESPAsyncWebServer-esphome", "1.3.0") cg.add_library("esphome/ESPAsyncWebServer-esphome", "1.3.0")