1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-06 10:50:58 +01:00

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.config_validation as cv
from esphome.components import sensor, ble_client
from esphome.core import CORE
from esphome.const import (
DEVICE_CLASS_CARBON_DIOXIDE,
@ -116,3 +117,6 @@ async def to_code(config):
if CONF_TVOC in config:
sens = await sensor.new_sensor(config[CONF_TVOC])
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.web_server_base import CONF_WEB_SERVER_BASE_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"]
DEPENDENCIES = ["wifi"]
@ -32,3 +32,7 @@ async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID], paren)
await cg.register_component(var, config)
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_build_flag(f"-DUSE_ESP32_VARIANT_{config[CONF_VARIANT]}")
cg.add_platformio_option("lib_ldf_mode", "off")
conf = config[CONF_FRAMEWORK]
if conf[CONF_TYPE] == FRAMEWORK_ESP_IDF:
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_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]))
if CORE.is_esp8266 and not config[CONF_ESP8266_DISABLE_SSL_SUPPORT]:
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)

View File

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi
from esphome.const import CONF_ID
from esphome.core import CORE
DEPENDENCIES = ["spi"]
AUTO_LOAD = ["sensor"]
@ -23,3 +24,6 @@ async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(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):
if config[CONF_DISABLED]:
return
cg.add_define("USE_MDNS")
if CORE.using_arduino:
if CORE.is_esp32:
cg.add_library("ESPmDNS", None)
elif CORE.is_esp8266:
cg.add_library("ESP8266mDNS", None)
if config[CONF_DISABLED]:
return
cg.add_define("USE_MDNS")
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)

View File

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

View File

@ -10,7 +10,7 @@ from esphome.const import (
CONF_SPI_ID,
CONF_CS_PIN,
)
from esphome.core import coroutine_with_priority
from esphome.core import coroutine_with_priority, CORE
CODEOWNERS = ["@esphome/core"]
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])
cg.add(var.set_mosi(mosi))
if CORE.is_esp32:
cg.add_library("SPI", None)
def spi_device_schema(cs_pin_required=True):
"""Create a schema for an SPI device.

View File

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