Commit Graph
446 Commits
Author SHA1 Message Date
J. Nick Koston 1336198423 Merge branch 'warn-crystal-mismatch' into integration
# Conflicts:
#	tests/unit_tests/test_util.py
2026-03-06 22:45:07 -10:00
J. Nick KostonandClaude Opus 4.6 696c0f021c Patch at import point instead of subprocess.run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:38:44 -10:00
J. Nick KostonandClaude Opus 4.6 9f72d5e428 Add test for run_external_process line_callbacks coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:35:33 -10:00
J. Nick Koston dc4506453e Add tests for crystal callback wiring in upload_using_esptool
Tests both the in-process (run_external_command) and subprocess
(run_external_process) paths to ensure line_callbacks are passed.
2026-03-06 22:29:23 -10:00
J. Nick Koston 511e47b0f5 Remove unnecessary CORE mock from tests
CORE.reset() is called after each test via the reset_core fixture,
and CORE.dashboard defaults to False, so patching is not needed.
2026-03-06 22:26:12 -10:00
J. Nick Koston ae8dabc41a Add test for run_external_command with line_callbacks 2026-03-06 22:25:18 -10:00
J. Nick Koston c2747a6d35 Add tests and use walrus operator for crystal freq check 2026-03-06 22:09:52 -10:00
J. Nick Koston c1c73dd619 Merge remote-tracking branch 'upstream/protect_entity_setters' into integration
# Conflicts:
#	tests/component_tests/binary_sensor/test_binary_sensor.py
#	tests/component_tests/button/test_button.py
#	tests/component_tests/text/test_text.py
#	tests/component_tests/text_sensor/test_text_sensor.py
2026-03-06 11:16:34 -10:00
J. Nick Koston c956b33e93 Add comment noting shift correctness is verified by integration test 2026-03-06 11:02:35 -10:00
J. Nick Koston 86dd579dea Remove internal shift constants from unit tests
Tests now verify packed values via comment strings and non-zero
checks rather than decoding individual bit positions. This removes
the coupling to internal bit layout constants.
2026-03-06 11:00:19 -10:00
J. Nick Koston dffb964e0c Merge branch 'protect_entity_setters' into integration 2026-03-06 09:56:13 -10:00
J. Nick Koston 54a8f558d6 Convert finalize tests to end-to-end through public API
Tests now go through _setup_entity_impl + setup_device_class/
setup_unit_of_measurement + finalize_entity_strings using real
CONF_* keys instead of internal _KEY_* constants.
2026-03-06 09:51:26 -10:00
J. Nick Koston c37f1481ce Derive entity category names from cv.ENTITY_CATEGORIES and cleanup
- Remove hardcoded _ENTITY_CATEGORY_NAMES dict, derive from cv.ENTITY_CATEGORIES keys
- Remove redundant local import re (already at top level)
- Remove last setup_test_environment noqa line
2026-03-06 09:46:28 -10:00
J. Nick Koston 7117ded6b6 [core] Pack entity flags into configure_entity_() and protect setters
Move set_internal(), set_disabled_by_default(), set_entity_category(),
and set_device() to protected on EntityBase. These were codegen-only
setters never intended for runtime use.

internal, disabled_by_default, and entity_category are now packed into
the existing configure_entity_() uint32 parameter alongside string
indices, eliminating up to 3 separate function calls per entity.

set_device() is renamed to set_device_() per protected naming convention
and remains a separate call (pointer can't be packed).

Entity category integer mapping is derived from cv.ENTITY_CATEGORIES
to stay in sync with the C++ enum automatically.
2026-03-06 09:35:30 -10:00
J. Nick Koston 379e0b060f Merge branch 'configure_entity' into integration
# Conflicts:
#	esphome/components/api/api_connection.cpp
#	esphome/components/api/api_connection.h
#	esphome/core/application.h
#	esphome/core/config.py
#	esphome/core/entity_base.h
2026-03-06 08:47:29 -10:00
J. Nick Koston fd19bb4aa3 Merge remote-tracking branch 'upstream/dev' into configure_entity
# Conflicts:
#	esphome/core/entity_base.h
2026-03-06 08:40:31 -10:00
J. Nick KostonandCopilot 8a915dcbbe [core] Move device class strings to PROGMEM on ESP8266 (#14443)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-06 08:34:27 -10:00
J. Nick Koston 6b53ccc85a make it safer 2026-03-06 07:39:49 -10:00
J. Nick Koston 79d7795c07 Merge branch 'dev' into configure_entity 2026-03-06 07:33:40 -10:00
J. Nick Koston a16b8fc0ac [rp2040] Fix Pico W LED pin and auto-generate board definitions for arduino-pico 5.5.x (#14528) 2026-03-06 07:00:31 -10:00
J. Nick KostonandCopilot 74e4b69654 [core] Replace Application name/friendly_name std::string with StringRef (#14532)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-03-06 06:58:13 -10:00
J. Nick Koston 07e51886f3 [core] Move entity icon strings to PROGMEM on ESP8266 (#14437) 2026-03-06 06:57:52 -10:00
J. Nick Koston dedabba199 Merge branch 'app-name-stringref' into integration
# Conflicts:
#	esphome/core/application.h
2026-03-05 15:46:47 -10:00
J. Nick Koston 363086b4f1 Extract make_app_name_cpp as testable free function with unit tests
Move the pure logic (string building, escaping, byte length
calculation) out of the nested closure into a module-level function
that can be tested without codegen mocks. Tests cover both copilot
review concerns: empty friendly_name with MAC suffix, and UTF-8
byte length for non-ASCII characters.
2026-03-05 15:35:31 -10:00
J. Nick Koston 0596980326 Merge branch 'rp2040-auto-gen-boards' into integration 2026-03-05 14:43:00 -10:00
J. Nick Koston 46d325065f Filter out placeholder pin values (e.g. 99) during board generation 2026-03-05 14:31:08 -10:00
J. Nick Koston b4c121fecf Merge branch 'rp2040-auto-gen-boards' into integration 2026-03-05 14:14:16 -10:00
J. Nick Koston 3bebe728e4 Merge remote-tracking branch 'origin/rp2040-upload-improvements' into integration 2026-03-05 14:14:10 -10:00
J. Nick Koston e103ca20ba [rp2040] Auto-generate boards.py from arduino-pico, fix Pico W LED pin
Add generate_boards.py script that reads board definitions and variant
pin headers from the arduino-pico repository to auto-generate boards.py
with support for 143+ boards including RP2350 variants.

Fix the Pico W LED pin from 32 (non-existent GPIO, never worked) to 64
(CYW43 wireless GPIO 0, hardware verified).

Make gpio.py pin validation data-driven:
- CYW43 virtual pin detection uses board pin map data
- Pin range based on MCU type from generated board metadata
- No hardcoded board names or magic numbers
2026-03-05 13:51:43 -10:00
J. Nick Koston aba845691f Fix picotool tests on Windows
Use platform-appropriate binary name (picotool.exe on Windows)
when creating mock picotool files in tests.
2026-03-05 13:31:47 -10:00
J. Nick Koston 53da01a2bf Merge branch 'rp2040-upload-improvements' into integration 2026-03-05 13:11:22 -10:00
J. Nick Koston ddbae0dd00 [rp2040] Always show BOOTSEL tip when no BOOTSEL device detected
Serial ports in the chooser may belong to other devices (e.g. FT232R),
not the RP2040. Show the BOOTSEL tip whenever no BOOTSEL device is
detected via picotool, regardless of whether serial ports are present.
2026-03-05 13:08:12 -10:00
J. Nick Koston aec76fafce [rp2040] Use picotool for BOOTSEL upload instead of mass storage copy
Replace UF2 file copy to mass storage volume with direct picotool upload.
This avoids macOS "disk not ejected properly" warnings caused by the RP2040
resetting immediately after receiving the firmware.

- Use picotool (already installed by PlatformIO) for BOOTSEL detection
  and firmware upload via USB
- Upload ELF directly with `picotool load -v -x` for real-time progress
- Remove platform-specific mass storage volume detection (macOS/Linux/Windows)
- Show helpful udev rules message on Linux permission errors
2026-03-05 12:59:07 -10:00
J. Nick Koston cfc74ad638 Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:25:09 -10:00
J. Nick Koston f886aa7f9a [rp2040] Fix firmware.bin.signed creation for nobuild upload
Move signed bin creation from post_build script to upload_using_platformio.
The post_build AddPostAction only runs during build, not during nobuild
upload, so the file was missing when PlatformIO tried to upload.
Now create firmware.bin.signed before calling PlatformIO upload.
2026-03-04 14:24:48 -10:00
J. Nick Koston d30175d84d Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:18:29 -10:00
J. Nick Koston d856046830 [rp2040] Add test coverage for Linux and Windows mass storage detection
Add tests for get_rp2040_mass_storage_volumes() on Linux, Windows,
and unsupported platforms to improve test coverage.
2026-03-04 14:12:39 -10:00
J. Nick Koston 5f79e3e0c2 [rp2040] Fix test assertions for Windows path separators
Use str(Path(...)) in test assertions so paths match platform-specific
separators (forward slashes on Unix, backslashes on Windows).
2026-03-04 14:00:35 -10:00
J. Nick Koston 74dd61442a [rp2040] Improve upload experience with mass storage and BOOTSEL support
Add auto-detection of RP2040 BOOTSEL mass storage volumes (RPI-RP2) on
macOS, Linux, and Windows. Show detected volumes as upload targets with
a progress bar for UF2 file copy. Display helpful BOOTSEL instructions
when no RP2040 device is found.

- Add get_rp2040_mass_storage_volumes() to detect mounted RPI-RP2 volumes
- Add PortType.MASS_STORAGE and upload_using_uf2_copy() with progress bar
- Move ProgressBar to helpers.py for shared use
- Wait for USB-CDC serial port after upload for log output
- Auto-select single serial port for logs after mass storage upload
- Create firmware.bin.signed in post_build to fix nobuild upload target
- Show BOOTSEL tip when only OTA options are available
2026-03-04 13:50:52 -10:00
J. Nick Koston c52ff5dcbc Merge branch 'configure_entity' into integration
# Conflicts:
#	esphome/core/entity_base.h
2026-03-03 12:12:01 -10:00
J. Nick KostonandClaude Opus 4.6 42fa6ef818 [core] Merge set_name + set_entity_strings into configure_entity
Every entity generated two codegen calls:
  entity->set_name("Name", hash);
  entity->set_entity_strings(packed);

Merge these into a single configure_entity(name, hash, packed) call
to reduce generated code size. For a config with 50+ entities this
eliminates 50+ function calls from the generated setup() function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:47:14 -10:00
J. Nick Koston 214a27d49f Merge branch 'move_device_class_progmem' into integration 2026-03-03 11:23:20 -10:00
J. Nick Koston 2fe9de7dbc add max length validation for device class strings
Defense-in-depth: validate device class strings don't exceed the
48-byte PROGMEM buffer limit (47 chars + null), matching the same
pattern used for icon strings.
2026-03-03 11:23:06 -10:00
J. Nick Koston 6fd20056ad Merge branch 'move_icons_progmem' into integration 2026-03-03 08:23:52 -10:00
J. Nick Koston 1108511c63 move icons to progmem 2026-03-03 08:06:55 -10:00
J. Nick Koston 1f1b20f4fe [core] Pack entity string properties into PROGMEM-indexed uint8_t fields (#14171) 2026-03-03 07:03:24 -10:00
J. Nick Koston 74eda7fc01 Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-03-02 09:31:46 -10:00
J. Nick Koston 8ee800bb35 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 07:53:19 -10:00
J. Nick Koston 96a564a6e9 [core] Replace Python unit tests with C++ integration test for micros_to_millis
The Python tests were testing a Python reimplementation, not the
actual C++ code. Replace with an integration test that exercises
the real micros_to_millis() on the host platform, covering boundary
values, carry paths, and mod-8 shift edge cases (25 checks).
2026-03-02 07:41:52 -10:00
J. Nick Koston 61eb8f3e14 Merge remote-tracking branch 'upstream/cache-lwip-sock-pointers' into integration
# Conflicts:
#	esphome/components/esp32/core.cpp
#	esphome/components/esp8266/core.cpp
#	esphome/components/host/core.cpp
#	esphome/components/libretiny/core.cpp
#	esphome/components/rp2040/core.cpp
#	esphome/components/zephyr/core.cpp
#	esphome/core/application.cpp
#	esphome/core/hal.h
2026-03-02 07:38:28 -10:00