Commit Graph

22689 Commits

Author SHA1 Message Date
J. Nick Koston
d3fc9ec1ec Merge branch 'constexpr-cse7761' into integration 2026-02-18 21:13:42 -06:00
J. Nick Koston
5cb0267d4d [cse7761] Use constexpr for compile-time constants 2026-02-18 21:13:19 -06:00
J. Nick Koston
ecdbe18cf6 Merge branch 'constexpr-ble-followup' into integration 2026-02-18 21:08:46 -06:00
J. Nick Koston
a8cf54face [bluetooth_proxy] Use constexpr for remaining compile-time constants
Followup to #14073 addressing review feedback.
2026-02-18 21:08:08 -06:00
J. Nick Koston
8f9581c5ce Merge branch 'constexpr-ld2420' into integration 2026-02-18 21:05:35 -06:00
J. Nick Koston
115d700e5c [ld2420] Use constexpr for compile-time constants 2026-02-18 21:03:36 -06:00
J. Nick Koston
8e83c141a9 Merge branch 'constexpr-nfc' into integration 2026-02-18 21:02:19 -06:00
J. Nick Koston
48502d22e6 Merge branch 'constexpr-pn71xx' into integration 2026-02-18 21:02:14 -06:00
J. Nick Koston
70b77754c5 [pn7160] Use constexpr for compile-time constants
pn7160.h and pn7150.h are each included by 3 translation units,
so static const causes duplicate copies in each TU's literal pool.
constexpr allows the compiler to use immediate values instead.
2026-02-18 20:59:31 -06:00
J. Nick Koston
c855e20434 [nfc] Use constexpr for compile-time constants
These headers are included by multiple translation units, so
static const causes duplicate copies in each TU's literal pool.
constexpr allows the compiler to use immediate values instead.
2026-02-18 20:58:19 -06:00
J. Nick Koston
683f5783dd Merge branch 'constexpr-remote-base' into integration 2026-02-18 20:56:11 -06:00
J. Nick Koston
e756ae1f0c Merge branch 'constexpr-mqtt' into integration 2026-02-18 20:56:06 -06:00
J. Nick Koston
ac0d163b0e Merge branch 'constexpr-packet-transport' into integration 2026-02-18 20:55:55 -06:00
J. Nick Koston
6bb4f24e6f Merge branch 'constexpr-ble' into integration 2026-02-18 20:55:50 -06:00
J. Nick Koston
52e6633e6e Merge branch 'constexpr-api' into integration 2026-02-18 20:55:43 -06:00
J. Nick Koston
f9c171b347 Merge branch 'constexpr-core-constants' into integration 2026-02-18 20:55:39 -06:00
J. Nick Koston
ba30496a7e Merge branch 'constexpr-high-impact-constants' into integration 2026-02-18 20:55:31 -06:00
J. Nick Koston
4eeef177af [remote_base] Use constexpr for compile-time constants 2026-02-18 20:39:45 -06:00
J. Nick Koston
e11dbed85f [mqtt] Use constexpr for compile-time constants 2026-02-18 20:37:58 -06:00
J. Nick Koston
872594ec6f [packet_transport] Use constexpr for compile-time constants 2026-02-18 20:36:43 -06:00
J. Nick Koston
3ee7f3197c [bluetooth_proxy] Use constexpr for compile-time constants 2026-02-18 20:35:54 -06:00
J. Nick Koston
abea6fabbb [api] Use constexpr for compile-time constant 2026-02-18 20:35:04 -06:00
J. Nick Koston
cf2e9dfd11 [core] Use constexpr for compile-time constants
Replace const with constexpr for integer constants initialized
with literal values to enable compile-time evaluation.
2026-02-18 20:31:00 -06:00
J. Nick Koston
565443b710 [pulse_counter] Fix compilation on ESP32-C6/C5/H2/P4 (#14070) 2026-02-18 19:08:53 -06:00
J. Nick Koston
3b869f1720 [web_server] Double socket allocation to prevent connection exhaustion (#14067) 2026-02-18 19:01:37 -06:00
J. Nick Koston
5f82017a31 [udp] Register socket consumption for CONFIG_LWIP_MAX_SOCKETS (#14068) 2026-02-18 19:01:00 -06:00
J. Nick Koston
c28f9b148c Merge branch 'udp-consume-sockets' into integration 2026-02-18 18:45:32 -06:00
J. Nick Koston
c58ecaf909 Merge branch 'fix-pulse-counter-c6-compile' into integration 2026-02-18 18:45:24 -06:00
J. Nick Koston
9dd62b8c34 [pulse_counter] Fix compilation on ESP32-C6/C5/H2/P4
SOC_MOD_CLK_APB does not exist in the soc_module_clk_t enum on
ESP32-C6, C5, H2, and P4 variants. Revert to esp_clk_apb_freq()
which works on all variants and is the same function the ESP-IDF
PCNT driver uses internally for glitch filter calculation.
2026-02-18 18:39:35 -06:00
J. Nick Koston
2ddf46ff0a Fix ConfigType import 2026-02-18 18:31:41 -06:00
J. Nick Koston
d814b0fc77 [udp] Register socket consumption for CONFIG_LWIP_MAX_SOCKETS
The UDP component creates up to 2 sockets (broadcast + listen) but
did not register them with the socket consumption API. This could
cause CONFIG_LWIP_MAX_SOCKETS to be set too low on ESP32 IDF.

Closes https://github.com/esphome/esphome/issues/14031
2026-02-18 18:27:41 -06:00
J. Nick Koston
5226a4dd75 Merge branch 'web-server-bump-sockets' into integration 2026-02-18 18:24:18 -06:00
J. Nick Koston
0393cae770 Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/components/http_request/http_request.h
#	esphome/components/http_request/http_request_arduino.cpp
#	esphome/components/http_request/http_request_arduino.h
#	esphome/components/http_request/http_request_host.cpp
#	esphome/components/http_request/http_request_host.h
#	esphome/components/http_request/http_request_idf.cpp
#	esphome/components/http_request/http_request_idf.h
#	esphome/core/component.cpp
2026-02-18 18:23:52 -06:00
J. Nick Koston
3db34b4029 [web_server] Double socket allocation to prevent connection exhaustion
Browsers open multiple concurrent connections for page resources, SSE
event streams, and POST requests for entity control. POST connections
may linger before closing, causing httpd_accept_conn errors (ENFILE)
when the socket pool is too small.
2026-02-18 18:18:59 -06:00
J. Nick Koston
86ad7f287c Merge branch 'json_web_server_stack' into integration 2026-02-18 18:11:12 -06:00
J. Nick Koston
2dd767ed3f [json] Bump heap fallback cap from 4096 to 5120
Aligns with the doubling sequence from 640: 1280 -> 2560 -> 5120.
2026-02-18 18:10:29 -06:00
J. Nick Koston
d967f47f3e [json] Increase SerializationBuffer stack size from 512 to 640 bytes
The reduction from 768 to 512 was overly aggressive - the stack
overflow was caused by the 1400+ byte multipart parser, not the
serialization buffer. 640 bytes covers climate DETAIL_ALL payloads
(~520 bytes) on the stack without heap fallback.
2026-02-18 18:07:23 -06:00
J. Nick Koston
fee4dc6783 Merge remote-tracking branch 'origin/integration' into integration 2026-02-18 17:54:21 -06:00
J. Nick Koston
52e870a10b Merge branch 'json_web_server_stack' into integration 2026-02-18 17:54:03 -06:00
J. Nick Koston
bb6600985f [json] Make heap fallback max size constexpr 2026-02-18 17:53:29 -06:00
J. Nick Koston
1ba1ab7fe2 [json] Document heap fallback buffer sizing expectations
Payloads exceeding 1024 bytes are not known to exist in real
configurations. One doubling iteration covers all known entity types.
Cap at 4096 as a safety limit.
2026-02-18 17:53:12 -06:00
J. Nick Koston
b0669e3c81 Merge branch 'json_web_server_stack' into integration 2026-02-18 17:52:38 -06:00
J. Nick Koston
6bb8e7dae6 Merge branch 'json_web_server_stack' into integration 2026-02-18 17:52:26 -06:00
J. Nick Koston
90ed0db0d9 [json] Replace measureJson() with doubling strategy in heap fallback
Avoids instantiating DummyWriter templates (~736 bytes flash) by
doubling the heap buffer until the payload fits. The temporary
over-allocation (at most 2x) is acceptable since payloads exceeding
the 512-byte stack buffer are rare.
2026-02-18 17:51:20 -06:00
J. Nick Koston
6820e1d6b3 [json] Replace measureJson() with doubling strategy in heap fallback
Avoids instantiating DummyWriter templates (~736 bytes flash) by
doubling the heap buffer until the payload fits. The temporary
over-allocation (at most 2x) is acceptable since payloads exceeding
the 512-byte stack buffer are rare.
2026-02-18 17:51:02 -06:00
J. Nick Koston
8337743a22 Merge branch 'json_web_server_stack' into integration 2026-02-18 17:39:53 -06:00
J. Nick Koston
6a7925b3ce [json] Fix SerializationBuffer truncation when payload exceeds stack buffer
ArduinoJson's serializeJson() with a bounded buffer returns the actual
bytes written (truncated count), NOT the would-be size like snprintf().
When the payload exceeded the 512-byte stack buffer, the return value
was used as the exact size for heap reallocation, but this was only the
truncated count. The heap buffer was allocated too small, the second
serialization was also truncated, and no NUL terminator was written.

This caused corrupted JSON in SSE streams for entities with payloads
exceeding 512 bytes (e.g., climate DETAIL_ALL with many features).

Fix: use measureJson() in the heap fallback path to get the exact
untruncated size before allocating. Also add the missing set_size_()
call after the second serialization to ensure proper NUL termination.
2026-02-18 17:36:56 -06:00
J. Nick Koston
47ccb52184 Merge branch 'water-heater-web-server-traits' into integration 2026-02-18 17:06:53 -06:00
J. Nick Koston
1dc6801a19 Merge branch 'web-server-climate-preset' into integration 2026-02-18 17:06:44 -06:00
J. Nick Koston
3a53c5a689 [web_server] Fix water_heater traits in JSON state events
Move min/max temperature and step traits into DETAIL_ALL block
so they are only sent once on initial connection instead of on
every state update. Rename keys from min_temperature/max_temperature
to min_temp/max_temp to match what the frontend expects.

Discovered while reviewing #14061.
2026-02-18 16:58:08 -06:00