mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
[wifi][openthread] Wire ESP32-S31/H4/H21 radio support (#17186)
This commit is contained in:
@@ -3,6 +3,9 @@ from esphome.components.esp32 import (
|
||||
VARIANT_ESP32C5,
|
||||
VARIANT_ESP32C6,
|
||||
VARIANT_ESP32H2,
|
||||
VARIANT_ESP32H4,
|
||||
VARIANT_ESP32H21,
|
||||
VARIANT_ESP32S31,
|
||||
add_idf_sdkconfig_option,
|
||||
get_esp32_variant,
|
||||
include_builtin_idf_component,
|
||||
@@ -187,7 +190,14 @@ def _validate_platform(config):
|
||||
if CORE.using_zephyr:
|
||||
return config
|
||||
return only_on_variant(
|
||||
supported=[VARIANT_ESP32C5, VARIANT_ESP32C6, VARIANT_ESP32H2]
|
||||
supported=[
|
||||
VARIANT_ESP32C5,
|
||||
VARIANT_ESP32C6,
|
||||
VARIANT_ESP32H2,
|
||||
VARIANT_ESP32H4,
|
||||
VARIANT_ESP32H21,
|
||||
VARIANT_ESP32S31,
|
||||
]
|
||||
)(config)
|
||||
|
||||
|
||||
|
||||
@@ -76,14 +76,20 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
AUTO_LOAD = ["network"]
|
||||
|
||||
NO_WIFI_VARIANTS = [const.VARIANT_ESP32H2, const.VARIANT_ESP32P4]
|
||||
NO_WIFI_VARIANTS = [
|
||||
const.VARIANT_ESP32H2,
|
||||
const.VARIANT_ESP32H4,
|
||||
const.VARIANT_ESP32H21,
|
||||
const.VARIANT_ESP32P4,
|
||||
]
|
||||
|
||||
|
||||
def variant_has_wifi(variant: str) -> bool:
|
||||
"""Return True if *variant* has a native WiFi PHY.
|
||||
|
||||
Variants without a native PHY (ESP32-H2, ESP32-P4) need the
|
||||
``esp32_hosted`` co-processor to use ``wifi:``.
|
||||
Variants without a native PHY (see ``NO_WIFI_VARIANTS`` — currently
|
||||
ESP32-H2, ESP32-H4, ESP32-H21, ESP32-P4) need the ``esp32_hosted``
|
||||
co-processor to use ``wifi:``.
|
||||
|
||||
Case-insensitive on *variant* so external callers can pass either
|
||||
the upstream uppercase form (e.g. ``"ESP32H2"`` from
|
||||
|
||||
Reference in New Issue
Block a user