Commit Graph

14040 Commits

Author SHA1 Message Date
J. Nick Koston 29bc97cdb8 Fix comments: remove PR-relative wording 2026-03-26 17:45:31 -10:00
J. Nick Koston dcdde00559 Merge branch 'dev' into fan-store-preset-modes-on-entity 2026-03-26 17:40:28 -10:00
Edward Firmo 6feb2d04df [nextion] Replace static std::string COMMAND_DELIMITER with constexpr (#15195)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-26 17:36:35 -10:00
J. Nick Koston 0221db0f13 Merge branch 'dev' into fan-store-preset-modes-on-entity 2026-03-26 17:06:40 -10:00
J. Nick Koston 05a5c27b90 Add 2026.11.0 removal comments to integration test and fixture 2026-03-26 16:21:30 -10:00
J. Nick Koston cfbba0af90 Add comment about string literal pointer stability in compat save_state_ 2026-03-26 16:18:01 -10:00
J. Nick Koston 541ab9abf9 Fix fan test: use fan_schema(), remove unnecessary get_setup_priority 2026-03-26 16:07:20 -10:00
J. Nick Koston 90dafa3fa4 [logger] Warn when VERBOSE/VERY_VERBOSE logging is active (#15189) 2026-03-27 01:59:58 +00:00
J. Nick Koston 794b7ef562 Fix supports_preset_modes: use same precedence as getter 2026-03-26 15:55:49 -10:00
J. Nick Koston 7513db9dcd Fix clang-tidy: protected method needs trailing underscore 2026-03-26 15:50:10 -10:00
J. Nick Koston 3388d420ec Fix unused services variable in test 2026-03-26 15:42:36 -10:00
J. Nick Koston 7c259d2f64 Simplify save_state_ compat path, move CopyFan preset copy to setup()
- save_state_(): split into two clear branches instead of conditional
  FanTraits construction trick
- CopyFan: copy source preset modes once in setup() instead of on
  every get_traits() call
2026-03-26 15:39:29 -10:00
J. Nick Koston 3328423373 Move pointer setter to protected with friend class Fan 2026-03-26 15:31:27 -10:00
J. Nick Koston 95cdc90835 Fix to_code signature: add ConfigType annotation 2026-03-26 15:27:20 -10:00
J. Nick Koston 576b1c3ff0 Fix fan fixture: use C++17 namespace style 2026-03-26 15:25:13 -10:00
J. Nick Koston c8d842586a Fix fan fixture: remove unnecessary build flags 2026-03-26 15:23:44 -10:00
J. Nick Koston 2f93ba0d71 Add integration test for deprecated FanTraits compat layer 2026-03-26 15:21:11 -10:00
J. Nick Koston e77cdb5971 [light] Validate effect names during config validation instead of codegen (#15107) 2026-03-26 15:13:44 -10:00
J. Nick Koston 90e6c0d7c7 [core] Remove indirection from ControllerRegistry dispatch (#15173) 2026-03-26 15:09:16 -10:00
J. Nick Koston 240e53afce [fan] Add benchmarks for fan component (#15210) 2026-03-26 14:35:09 -10:00
J. Nick Koston c42cfac50f Fix dangling reference in save_state_, restore deleted string overloads
1. save_state_() bound a reference to supported_preset_modes() from
   a temporary FanTraits returned by get_traits(). When the compat
   path fired, the temporary was destroyed and the reference dangled.
   Fix: keep the FanTraits alive for the loop duration.

2. Restore deleted std::vector<std::string> / initializer_list<std::string>
   overloads to preserve clear compile-time diagnostics.
2026-03-26 14:28:55 -10:00
J. Nick Koston 56f0d3f7f5 Fix compat: use owned vector instead of leak, wire preset modes in subclasses
- Deprecated FanTraits setters store in an owned compat_preset_modes_
  vector (same copy cost as pre-PR). No heap leak, no dangling pointer.
- Subclass get_traits() calls wire_preset_modes_() to attach the
  Fan-owned pointer to the returned traits.
- Getter/find/supports all check compat vector as fallback.
2026-03-26 14:08:07 -10:00
J. Nick Koston 4838c61a8c Move preset modes pointer to private, consolidate empty vector to cpp
- Move supported_preset_modes_ pointer and ensure helper to private
- Move static EMPTY_VECTOR from inline header getter to a single
  file-scope constant in fan.cpp (avoids duplication per TU)
- Add 2026.11.0 removal comments on all compat code paths
2026-03-26 14:02:27 -10:00
J. Nick Koston 5be5f16662 Fix compat: heap-allocate deprecated vector, add find fallback
Two bugs fixed from Copilot review:

1. Dangling pointer on copy: deprecated setters stored data in an
   OwnedPresetModes struct on FanTraits. If the traits object was
   copied, the copy's pointer dangled. Fix: deprecated setters now
   heap-allocate (intentional leak). Pointer survives any copy.
   Remove the OwnedPresetModes wrapper entirely.

2. find_preset_mode_ / save_state_ only searched the Fan-owned
   vector, breaking external components using the deprecated traits
   setters. Fix: fall back to get_traits() when the entity vector
   is null.
2026-03-26 13:52:41 -10:00
J. Nick Koston fa8a609bcc [automation] Eliminate trigger trampolines with deduplicated forwarder structs (#15174) 2026-03-26 13:50:50 -10:00
J. Nick Koston 554d97ff04 Fix clang-tidy: add braces around if statements, extract ensure helper 2026-03-26 13:33:15 -10:00
J. Nick Koston 4ff0d30e07 Use leak-on-purpose raw pointer for Fan-owned preset modes vector
Fan entities live for the entire program lifetime, so the preset
modes vector never needs to be freed. Use a raw pointer (null by
default, allocated on first set_supported_preset_modes() call)
instead of an inline std::vector member.

This saves 24 bytes of RAM per Fan instance for components that
don't use preset modes (binary, bedjet, tuya, etc.).
2026-03-26 13:24:58 -10:00
J. Nick Koston df58091d1d Make compat owned vector skip-on-copy to eliminate copy overhead
Wrap the deprecated owned vector in a struct with a no-op copy
constructor. FanTraits copies (which happen on every get_traits()
call) don't pay the 24-byte cost of copying an empty vector.
2026-03-26 13:14:52 -10:00
J. Nick Koston 237cfdebfc [fan] Store preset mode vector on Fan entity, not FanTraits
FanTraits contained a std::vector<const char *> for preset modes.
Every get_traits() call reconstructed this vector, causing heap
allocations on every publish_state() and control()/perform() call.

Move the vector storage to the Fan base class and have FanTraits hold
a const pointer instead. Internal callers (save_state_, find_preset_mode_)
search the Fan-owned vector directly, avoiding traits reconstruction.

The old FanTraits setters are preserved as deprecated compatibility
overloads (removed in 2026.11.0) that self-own the data, so external
components continue to compile — they just get a deprecation warning
and still heap-allocate until they migrate.
2026-03-26 13:04:59 -10:00
dependabot[bot] 6aafb521c1 Bump ruff from 0.15.7 to 0.15.8 (#15192)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-26 19:59:21 +00:00
Edward Firmo 81f0aa1168 [nextion] Replace or/and operators and missing this-> (#15191) 2026-03-26 09:54:50 -10:00
dependabot[bot] 3152642571 Bump codecov/codecov-action from 5.5.3 to 6.0.0 (#15194)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-26 09:48:06 -10:00
dependabot[bot] 1e2c410abf Bump cryptography from 46.0.5 to 46.0.6 (#15193)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-26 09:47:18 -10:00
J. Nick Koston a008c27fcf [climate] Avoid duplicate get_traits() in publish_state (#15181)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-26 15:01:08 -04:00
Clyde Stubbs 1edf952dda [font] Add unit tests verifying correct processing of glyphs (#15178) 2026-03-26 14:59:06 -04:00
Edward Firmo d9ada4536c [nextion] Fix leading space in pressed color string commands (#15190) 2026-03-26 14:58:12 -04:00
Jonathan Swoboda bf89a191f0 [wifi] Guard coex_background_scan with CONFIG_SOC_WIFI_SUPPORTED (#15187) 2026-03-26 13:39:35 -04:00
Jonathan Swoboda c2456409bd [core] Improve clean-all with no arguments (#15184) 2026-03-26 13:39:19 -04:00
J. Nick Koston 02e23eb386 [benchmark] Add light call and publish benchmarks (#15176) 2026-03-26 07:33:10 -10:00
J. Nick Koston 6898284361 [benchmark] Add cover publish_state and call benchmarks (#15179) 2026-03-26 07:32:54 -10:00
J. Nick Koston f3a31be6d0 [benchmark] Add climate publish_state and call benchmarks (#15180) 2026-03-26 07:32:39 -10:00
Daniel Kent 9260401747 [bmp581] Add SPI support for BMP581 (#13124)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-26 12:11:46 -04:00
J. Nick Koston 8a6b009173 [light] Move normal state logging to VERBOSE (#15177) 2026-03-26 15:53:33 +13:00
Keith Burzinski 676ac9d8b8 [infrared][ir_rf_proxy] Add receiver_frequency config for IR receiver demodulation frequency (#15156)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-26 15:30:46 +13:00
J. Nick Koston 29e263ad7d [esp32] Wrap vfprintf to fix printf stub on picolibc (IDF 6) (#15172) 2026-03-25 19:43:01 -04:00
Jonathan Swoboda a075f63b59 [uart] Fix debug callback missing peeked byte and reading past end (#15169) 2026-03-25 16:50:37 -04:00
J. Nick Koston ec60da893f [core] Move state logging to client-side formatting, console to VERBOSE (#15155) 2026-03-25 19:45:06 +00:00
dependabot[bot] d8fbce365a Bump requests from 2.32.5 to 2.33.0 (#15170)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 09:38:20 -10:00
Jonathan Swoboda f6c5767a83 [inkplate] Use atomic GPIO write to prevent ISR race (#15166) 2026-03-25 14:10:28 -04:00
Jonathan Swoboda 19615f2eae [bme68x_bsec2] Fix uninitialized bme68x_conf in measurement duration calculation (#15168) 2026-03-25 14:10:04 -04:00