Commit Graph

13 Commits

Author SHA1 Message Date
J. Nick Koston 41c413d5f7 Move extract_packed_value to shared component test helper
Add tests/component_tests/helpers.py with typed extract_packed_value()
and INTERNAL_BIT constant, replacing 5 duplicate copies.
2026-03-06 10:56:51 -10:00
J. Nick Koston c704d97804 Strengthen internal flag assertions in component tests
All internal-flag tests now extract the packed value and verify
bit 24 is set/clear for the correct entities, instead of just
checking configure_entity_() call presence.
2026-03-06 10:54:19 -10:00
J. Nick Koston dccc008383 Merge branch 'configure_entity' into protect_entity_setters 2026-03-06 09:44:16 -10:00
J. Nick Koston 69386cce2b Strengthen test assertions for configure_entity_ packed values
- Sensor and text_sensor device_class tests now extract and verify the
  packed argument is non-zero instead of just checking call presence
- Remove useless setup_test_environment fixture references in unit tests
2026-03-06 09:43:07 -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 6b53ccc85a make it safer 2026-03-06 07:39:49 -10:00
J. Nick Koston c0873973c1 fix component tests to match configure_entity codegen
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:53:27 -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 3cc6810be5 [core] Remove object_id RAM storage - no longer in hot path after #12627 (#12631) 2026-01-02 15:46:01 -10:00
J. Nick Koston cf8c205644 [core] Reduce flash size by combining set_name() and set_object_id() calls (#11941) 2025-11-25 12:15:45 -06:00
Clyde Stubbs 6486147da1 [mipi_spi] Template code, partial buffer support (#9314)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-07-16 11:05:27 +10:00
Jesse Hills b454f63b36 [core] Remove old style platform configuration (#8118) 2025-01-21 00:32:47 -06:00
dougiteixeira 323849c821 Add device class support to text sensor (#6202)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-02-26 11:29:39 +13:00