1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00

[json] Use ESP-IDF component registry for ArduinoJson on ESP32 (#13280)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jonathan Swoboda
2026-01-20 22:51:54 -05:00
committed by GitHub
parent 1095bde2db
commit acdc7bd892
4 changed files with 14 additions and 4 deletions

View File

@@ -1 +1 @@
d272a88e8ca28ae9340a9a03295a566432a52cb696501908f57764475bf7ca65
d15ae81646ac0ee76b2586716fe697f187281523ee6db566aed26542a9f98d1a

View File

@@ -1,6 +1,6 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.core import CoroPriority, coroutine_with_priority
from esphome.core import CORE, CoroPriority, coroutine_with_priority
CODEOWNERS = ["@esphome/core"]
json_ns = cg.esphome_ns.namespace("json")
@@ -12,6 +12,11 @@ CONFIG_SCHEMA = cv.All(
@coroutine_with_priority(CoroPriority.BUS)
async def to_code(config):
cg.add_library("bblanchon/ArduinoJson", "7.4.2")
if CORE.is_esp32:
from esphome.components.esp32 import add_idf_component
add_idf_component(name="bblanchon/arduinojson", ref="7.4.2")
else:
cg.add_library("bblanchon/ArduinoJson", "7.4.2")
cg.add_define("USE_JSON")
cg.add_global(json_ns.using)

View File

@@ -1,4 +1,6 @@
dependencies:
bblanchon/arduinojson:
version: "7.4.2"
espressif/esp-tflite-micro:
version: 1.3.3~1
espressif/esp32-camera:

View File

@@ -34,7 +34,6 @@ build_flags =
[common]
; Base dependencies for all environments
lib_deps_base =
bblanchon/ArduinoJson@7.4.2 ; json
wjtje/qr-code-generator-library@1.7.0 ; qr_code
functionpointer/arduino-MLX90393@1.0.2 ; mlx90393
pavlodn/HaierProtocol@0.9.31 ; haier
@@ -111,6 +110,7 @@ platform_packages =
framework = arduino
lib_deps =
${common:arduino.lib_deps}
bblanchon/ArduinoJson@7.4.2 ; json
ESP8266WiFi ; wifi (Arduino built-in)
Update ; ota (Arduino built-in)
ESP32Async/ESPAsyncTCP@2.0.0 ; async_tcp
@@ -201,6 +201,7 @@ platform_packages =
framework = arduino
lib_deps =
${common:arduino.lib_deps}
bblanchon/ArduinoJson@7.4.2 ; json
ESP32Async/ESPAsyncWebServer@3.7.8 ; web_server_base
build_flags =
${common:arduino.build_flags}
@@ -216,6 +217,7 @@ platform = libretiny@1.9.2
framework = arduino
lib_compat_mode = soft
lib_deps =
bblanchon/ArduinoJson@7.4.2 ; json
ESP32Async/ESPAsyncWebServer@3.7.8 ; web_server_base
droscy/esp_wireguard@0.4.2 ; wireguard
build_flags =
@@ -239,6 +241,7 @@ build_flags =
-DUSE_NRF52
lib_deps =
${common.lib_deps_base}
bblanchon/ArduinoJson@7.4.2 ; json
; All the actual environments are defined below.