Commit Graph

22929 Commits

Author SHA1 Message Date
J. Nick Koston e74506b957 Merge branch 'scheduler_de_template' into integration 2026-02-21 17:34:37 -06:00
J. Nick Koston 9b1480840f Merge remote-tracking branch 'upstream/dev' into scheduler_de_template
# Conflicts:
#	esphome/core/scheduler.h
2026-02-21 17:31:57 -06:00
J. Nick Koston 462ac29563 [scheduler] Use relaxed memory ordering for atomic reads under lock (#14140) 2026-02-21 17:29:41 -06:00
J. Nick Koston 6f198adb0c [scheduler] Reduce lock acquisitions in process_defer_queue_ (#14107) 2026-02-21 14:29:50 -06:00
J. Nick Koston e521522b38 [haier] Fix uninitialized HonSettings causing API connection failures (#14188) 2026-02-21 13:54:43 -06:00
J. Nick Koston 5a07908dfa [api] Fix build error when lambda returns StringRef in homeassistant.event data (#14187) 2026-02-21 13:54:20 -06:00
J. Nick Koston 9571a979eb [ci] Suggest StringRef instead of std::string_view (#14183) 2026-02-21 13:53:45 -06:00
tomaszduda23 48ba007c22 [nrf52] print line number after crash in logs (#14165) 2026-02-21 14:16:20 -05:00
Clyde Stubbs 6ff17fbf7c [epaper_spi] Fix color mapping for weact (#14134) 2026-02-22 04:17:54 +11:00
J. Nick Koston 416b97311b [mqtt] Remove broken ESP8266 ssl_fingerprints option (#14182) 2026-02-21 11:12:35 -06:00
J. Nick Koston 7fb09da7cf [dsmr] Add deprecated std::string overload for set_decryption_key (#14180) 2026-02-21 11:08:13 -06:00
Sxt Fov 6ecb01dedc [cc1101] actions to change general and tuner settings (#14141)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-21 08:45:15 -05:00
Clyde Stubbs 518f08b909 [mipi_dsi] Disallow swap_xy (#14124) 2026-02-21 19:51:13 +11:00
J. Nick Koston 9adb2dd3f1 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-20 23:45:45 -06:00
Rodrigo Martín 2eac106f11 [mqtt] add missing precision in HA autodiscovery (#14010) 2026-02-20 23:20:27 -05:00
J. Nick Koston 681bdf16aa Merge remote-tracking branch 'upstream/dev' into integration 2026-02-20 21:40:33 -06:00
J. Nick Koston f77da803c9 [api] Write protobuf encode output to pre-sized buffer directly (#14018) 2026-02-20 21:39:18 -06:00
J. Nick Koston f8f98bf428 [logger] Reduce UART driver heap waste on ESP32 (#14168) 2026-02-21 03:16:49 +00:00
J. Nick Koston abe37c9841 [uptime] Use scheduler millis_64() for rollover-safe uptime tracking (#14170) 2026-02-21 03:08:49 +00:00
J. Nick Koston 8589f80d8f [api,ota,captive_portal] Fix fd leaks and clean up socket_ip_loop_monitored setup paths (#14167) 2026-02-20 20:59:49 -06:00
J. Nick Koston f3b1ae6ba5 Merge branch 'setup_heap_stats' into integration 2026-02-20 20:51:54 -06:00
J. Nick Koston 487d311dbc tweak 2026-02-20 20:51:36 -06:00
J. Nick Koston dd7ef3d982 Merge branch 'fix_logger_uart_event_queue' into integration 2026-02-20 20:32:08 -06:00
J. Nick Koston ee8db03d84 Reduce logger UART RX buffer to minimum 129
The logger only writes to UART, never reads. Previously it used
tx_buffer_size (512 bytes) for both RX and TX buffers. Since ESP-IDF
requires rx_buffer_size > UART_HW_FIFO_LEN (128), use the minimum
of 129 bytes instead of 512, saving ~383 bytes of heap.
2026-02-20 20:31:48 -06:00
J. Nick Koston 730effe2a5 Merge branch 'fix_logger_uart_event_queue' into integration 2026-02-20 20:31:19 -06:00
J. Nick Koston da5f67af69 Reduce logger UART RX buffer to minimum
The logger only writes to UART, never reads. Previously it used
tx_buffer_size (512 bytes) for both RX and TX buffers. Since ESP-IDF
requires rx_buffer_size > UART_HW_FIFO_LEN (128), use the minimum
of 129 bytes instead of 512, saving ~383 bytes of heap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:30:29 -06:00
J. Nick Koston addd80684b Merge remote-tracking branch 'upstream/uptime_use_millis_64' into integration 2026-02-20 20:22:35 -06:00
J. Nick Koston 7a58a3ef56 [uptime] Use scheduler millis_64() for rollover-safe uptime tracking
Expose the scheduler's existing 64-bit millisecond tracking as a public
API and use it in the uptime sensors, replacing their manual rollover
handling.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-20 20:19:49 -06:00
J. Nick Koston 75ab691776 Merge branch 'fix_logger_uart_event_queue' into integration 2026-02-20 19:50:36 -06:00
J. Nick Koston 5de56714c0 Merge branch 'setup_heap_stats' into integration 2026-02-20 19:31:55 -06:00
J. Nick Koston c6c01f85af [setup_heap_stats] Add component to track per-component heap allocation during boot
Tracks heap usage per component during both construction and setup() phases.
Logs deltas inline as components are registered and set up, then prints a
sorted summary after setup() completes. Storage is freed after the summary.

This is a diagnostic tool - not intended for production use. It was used to
discover the logger's unused UART event queue allocation (#14168).
2026-02-20 19:29:41 -06:00
J. Nick Koston 0e38acd67a [api] Warn when clients connect with outdated API version (#14145) 2026-02-20 19:21:56 -06:00
J. Nick Koston a3f279c1cf [usb_host] Implement disable_loop/enable_loop pattern for USB components (#14163) 2026-02-20 19:21:14 -06:00
J. Nick Koston 35037d1a5b [core] Deduplicate base64 encode/decode logic (#14143)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:20:58 -06:00
J. Nick Koston d206c75b0b [logger] Fix loop disable optimization using wrong preprocessor guard (#14158) 2026-02-20 19:20:44 -06:00
J. Nick Koston 0fa7ba6837 [logger] Remove unused UART event queue allocation
The logger's uart_driver_install() was allocating a 10-item FreeRTOS
event queue but passing nullptr as the queue handle, meaning nothing
could ever read from it. Setting the queue size to 0 saves ~212 bytes
of heap.
2026-02-20 19:18:38 -06:00
J. Nick Koston 3855701f60 Merge branch 'loop_monitored_socket_cleanups' into integration 2026-02-20 18:21:18 -06:00
J. Nick Koston 5ea4b5b74b Improve comments explaining why explicit close() is unnecessary before delete 2026-02-20 18:20:56 -06:00
J. Nick Koston 4dd2b532c9 Merge branch 'loop_monitored_socket_cleanups' into integration 2026-02-20 18:18:12 -06:00
J. Nick Koston 9fc291e98f Address review: rename close_socket_ to destroy_socket_, use log helper for reuseaddr, clarify destructor behavior 2026-02-20 18:10:52 -06:00
J. Nick Koston f389314945 Address review comments: clarify socket type comments, use log helper for reuseaddr 2026-02-20 18:06:38 -06:00
J. Nick Koston 7a6df910e5 [api,ota,captive_portal] Use raw pointer for listen sockets to reduce flash
Replace std::unique_ptr<Socket> with raw Socket* for listen sockets
that are created once in setup() and live for the program lifetime.

The unique_ptr move-assign generates dead code to destroy the previous
value (which is always nullptr in setup), including a virtual destructor
call through the vtable that the compiler cannot eliminate because
__uniq_ptr_impl::reset is not inlined.

Changes:
- Use .release() to extract raw pointer from socket factory return
- Add socket_failed_/server_failed_ helpers that combine error logging,
  cleanup, and mark_failed into a single call
- Convert error messages to LOG_STR for flash storage on ESP8266
- Socket destructor already calls close(), so explicit close() before
  delete is unnecessary

Saves 20 bytes on ESP32-IDF, 180 bytes on ESP8266.
2026-02-20 17:57:23 -06:00
J. Nick Koston 09ac3bc1cb Merge remote-tracking branch 'origin/fix_logger_loop_disable' into integration 2026-02-20 17:04:06 -06:00
J. Nick Koston f13a62c5a2 Merge origin/dev into fix_logger_loop_disable
Resolve conflict in defines.h - keep both new NRF52 defines
(USE_LOGGER_EARLY_MESSAGE, USE_LOGGER_WAIT_FOR_CDC from dev) and
existing defines (USE_LOGGER_UART_SELECTION_USB_CDC, USE_LOGGER_USB_CDC
from this branch).
2026-02-20 17:02:01 -06:00
tomaszduda23 1d3054ef5e [nrf52,logger] Early debug (#11685) 2026-02-20 16:12:50 -06:00
J. Nick Koston e916f8cc8e [scheduler] De-template and consolidate scheduler helper functions
Remove unnecessary template parameters from mark_matching_items_removed_locked_
since all callers use the same concrete type (std::vector<std::unique_ptr<SchedulerItem>>).

Eliminate has_cancelled_timeout_in_container_locked_ entirely by inlining its
logic into the only caller (is_retry_cancelled_locked_), which is deprecated
and will be removed in 2026.8.0.

Saves 32 bytes of flash.
2026-02-20 15:40:07 -06:00
Jonathan Swoboda db6aa58f40 [max7219digit] Fix typo in action names (#14162)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:06:46 -05:00
J. Nick Koston 974897125e Merge remote-tracking branch 'origin/integration' into integration 2026-02-20 14:57:05 -06:00
J. Nick Koston 29cbc3f452 Merge branch 'usb_host_disable_loop' into integration 2026-02-20 14:56:33 -06:00
J. Nick Koston b756ef952a [usb_host] Implement disable_loop/enable_loop pattern for USB components
Reduce CPU usage when USB components are idle by disabling the
component loop when there are no events or data to process. The
loop is re-enabled from USB task callbacks via
enable_loop_soon_any_context() when new events or data arrive.

- Extract process_usb_events_() from USBClient::loop() returning
  bool so subclasses can combine with their own work checks for a
  single disable_loop() decision
- Add enable_loop_soon_any_context() calls in client_event_cb and
  USB data input callback
- Start with loop disabled in setup(), enabled by first event
- Reorder USBClient members by thread-safety context
- Reorder TransferStatus fields for optimal struct packing
- Fix missing early return after mark_failed() in setup()
2026-02-20 14:55:58 -06:00