Commit Graph
31 Commits
Author SHA1 Message Date
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 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 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 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 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 1f1b20f4fe [core] Pack entity string properties into PROGMEM-indexed uint8_t fields (#14171) 2026-03-03 07:03:24 -10:00
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>J. Nick Koston
4d05cd3059 Bump ruff from 0.14.14 to 0.15.0 (#13752)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-02-04 09:24:05 +00: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
9de7df7b5b Add build info to image (#12425)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-18 00:06:52 +00: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
Javier Peletier f18c70a256 [core] Fix substitution id redefinition false positive (#11603) 2025-10-30 07:06:55 +13:00
Jonathan Swoboda a809a13729 [core] Add support for extern "C" includes (#11422) 2025-10-21 15:46:50 +13:00
Jesse Hillspre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>J. Nick KostonJ. Nick Koston
9ea3643b74 [core] os.path -> Path (#10654)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2025-09-19 12:59:48 +00:00
J. Nick Koston 4859fe67eb [dashboard] Fix archive handler to properly delete build folders using correct path (#10724) 2025-09-16 11:04:35 +12:00
J. Nick Koston bd9dc43e59 Add additional coverage ahead of Path conversion (#10723) 2025-09-15 13:33:15 +12:00
J. Nick Koston 35dce3c80d Add additional test coverage ahead of Path conversion (#10700) 2025-09-15 09:31:38 +12:00
J. Nick Koston 6d834c019d Fix incorrect entity count due to undefined execution order with globals (#10497) 2025-09-01 13:01:15 +12:00
J. Nick Koston ca19959d7c [core] Improve error reporting for entity name conflicts with non-ASCII characters (#10329) 2025-08-25 08:11:54 +12:00
Jesse Hills 6a8722f33e [entity] Allow `device_id` to be blank on entities (#10217) 2025-08-14 09:42:11 +12:00
J. Nick Koston 82b7c1224c [core] Improve entity duplicate validation error messages (#10184) 2025-08-12 09:58:51 +12:00
J. Nick Kostonandpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> e40b45cab1 Add ability to have same entity names on different sub devices (#9355)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-07-16 21:34:51 +12:00
J. Nick Koston 0d94246858 Exclude internal entities from name uniqueness validation (#9410) 2025-07-10 20:34:01 +12:00
J. Nick Koston 9a0ba1657e Fix entity hash collisions by enforcing unique names across devices per platform (#9276) 2025-07-01 14:38:19 +12:00
b18ff48b4a [API] Sub devices and areas (#8544)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2025-06-25 12:03:41 +00:00