Commit Graph
170 Commits
Author SHA1 Message Date
Franck Nijhof 743b1489e1 Use probatio directly in tests, scripts and pylint plugins (#182113) 2026-09-13 17:24:06 +02:00
Franck Nijhof 91ba35fd1e Report the original error when removing an entity fails (#180481) 2026-08-28 15:59:42 -04:00
Erik Montnemery 7db136df88 Always call Entity.add_to_platform_abort when entity fails to add (#179509) 2026-08-27 18:23:15 +02:00
Erik Montnemery 1c939013d1 Remove the concept of device info types from device registry (#179397) 2026-08-19 12:11:23 +02:00
Franck Nijhof 1b117651ef Revert "Add Entity.async_get_recent_context helper" (#179496) 2026-08-18 19:18:33 +02:00
Paulus SchoutsenandClaude 3e085fb510 Add Entity.async_get_recent_context helper (#178425)
Co-authored-by: Claude <noreply@anthropic.com>
2026-08-18 17:30:51 +02:00
Erik Montnemery 43618effb8 Migrate calls to async_get_device in tests (part 6) (#178339) 2026-08-07 13:49:00 +02:00
Robert Resch 77e9fe3a35 Enable ruff rule RUF036 (none-not-at-end-of-union) (#177543) 2026-07-29 14:43:38 +02:00
Erik Montnemery cba75b8474 Clear Entity.device_entry when entity is detached from device (#177445) 2026-07-28 13:22:32 +02:00
Ariel Ebersberger 5432d29489 Use is/is not for same-enum identity comparisons (tests) (#171689) 2026-05-22 11:32:27 +02:00
Artur Pragacz f823ef639a Prefix area to entity ID (#170560) 2026-05-19 20:53:26 +02:00
9a1fd913bf Fix line length violations in tests (non-components) (#170804)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-17 10:30:45 -04:00
Artur Pragacz cb71628ee2 Validate entity ID domain (#167228) 2026-04-07 12:36:37 +02:00
Artur Pragacz 151eae4d5a Add compatibility layer for entities without has_entity_name to entity registry (#166246) 2026-03-24 20:22:15 +01:00
Artur Pragacz c6064f40d2 Use same code path for friendly name as for entity ID (#161250) 2026-01-27 00:13:53 +01:00
Jan Bouwhuis 34d6938171 Fix subentry ID is not updated when renaming the entity ID (#157498) 2025-12-01 07:55:13 +01:00
Erik Montnemery dd399ef59f Refactor EntityPlatform (#147927) 2025-07-22 14:35:57 +02:00
Erik Montnemery 8ce30d9559 Add tests of legacy entity without platform writing state (#148109) 2025-07-04 16:21:48 +02:00
Erik Montnemery 943fb9948b Adjust logic related to entity platform state (#147882)
* Adjust logic related to entity platform state

* Break up hard to read if-statement

* Add and improve tests
2025-07-02 14:57:53 +02:00
G Johansson db3090078b Remove deprecated support feature values in camera (#146988) 2025-06-22 09:31:16 +02:00
Erik Montnemery e39edcc234 Remove unused attribute EntityInfo.custom_component (#146550) 2025-06-11 17:27:17 +02:00
Erik Montnemery d860b35f41 Fix flaky test test_async_parallel_updates_with_zero_on_sync_update (#143810) 2025-04-28 09:27:26 +02:00
J. Nick Koston 34d17ca458 Move state length validation to StateMachine APIs (#143681)
* Move state length validation to StateMachine async_set method

We call validate_state to make sure we do not allow any states
into the state machine that have a length>255 so we do not break
the recorder. Since async_set_internal already requires callers
to pre-validate the state, we can move the check to async_set
instead of at State object creation time to avoid needing to
check it twice in the hot path (entity write state)

* move check in async_set_internal so it only happens on state change

* no need to check if same_state
2025-04-25 21:15:15 -04:00
Erik Montnemery dc8e1773f1 Remove unused defaults from entity_registry.RegistryEntry (#143655) 2025-04-25 12:41:58 +02:00
J. Nick Koston cb0523660d Improve error logging when state is too long (#143636) 2025-04-24 18:37:32 -10:00
Erik Montnemery 428cc1a951 Update signature of platforms' async_setup_entry in tests (#138271) 2025-02-11 13:17:39 +01:00
Ville Skyttä 40eb8b91cc Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
Franck Nijhof 00c052bb22 Revert "Remove deprecated supported features warning in ..." (multiple) (#134933) 2025-01-07 00:08:02 +01:00
epenet f2500e5a32 Remove deprecated supported features warning in MediaPlayer (#132365) 2024-12-09 23:03:55 +01:00
Erik Montnemery 0d447c9d50 Improve entity cached attributes (#128876) 2024-10-21 10:29:01 +02:00
J. Nick Koston 0f29fd3e10 Switch to using fast cached_property implementation in propcache (#127339) 2024-10-03 13:11:02 -05:00
epenet 56b4a7f291 Add missing hass type in tests/helpers (#124039) 2024-08-16 17:09:12 +02:00
Marc Mueller a6068dcdf2 Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
epenet 648ef94888 Improve type hints in core helper tests (#120096) 2024-06-21 15:43:27 +02:00
epenet 9f41133bbc Add missing argument type to core tests (#119667) 2024-06-14 08:42:01 +02:00
epenet 38a6e666a7 Add missing return type to some test functions (#119665) 2024-06-14 08:26:45 +02:00
epenet 7d631c28a6 Ignore attribute-defined-outside-init pylint warnings in tests (#119470) 2024-06-12 12:22:31 +02:00
J. Nick Koston 62b1bde0e8 Only entity verify state writable once after success unless hass is missing (#118896) 2024-06-06 11:46:44 -05:00
J. Nick Koston 475c20d529 Always do thread safety check when writing state (#118886)
* Always do thread safety check when writing state

Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.

Previously the check was limited to custom components
because they were the most common source of thread
safety issues.

* Always do thread safety check when writing state

Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.

Previously the check was limited to custom components
because they were the most common source of thread
safety issues.

* async_fire is more common than expected with ccs

* fix mock

* fix hass mocking
2024-06-05 23:41:55 -04:00
J. Nick Koston 79b4889812 Always do thread safety checks when writing state for custom components (#116044) 2024-04-24 10:05:52 +02:00
J. Nick Koston 53a179088f Add debug mode to catch unsafe thread operations using core helpers (#115390)
* adjust

* adjust

* fixes

* one more

* test

* debug

* move to config

* cover

* Update homeassistant/core.py

* set debug from RuntimeConfig

* reduce

* fix message

* raise

* Update homeassistant/core.py

* Update homeassistant/core.py

* no flood check for raise

* cover
2024-04-24 03:36:05 +02:00
Sid 895f73d8e4 Enable Ruff A001 (#115654) 2024-04-21 23:25:27 +02:00
Alberto Montes c94b0a82ca Make release channel a hardcoded enum rather than a free form string (#115595)
* Make release channel a hardcoded enum rather than a free form string

* Update enum comparison to remove equality and us identity comparison

* Fix comparison condition to match the previous implementation

* Update tests to use Enum instead of string
2024-04-20 20:01:49 +02:00
Marc Mueller 816ce116bf Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
SidandFranck Nijhof 00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Joost Lekkerkerker 05172d8e4d Improve loops and lists (#113269)
* Enable PERF

* Enable PERF rule

* Enable PERF rule

* Don't enable flag yet
2024-03-14 10:22:20 +01:00
J. Nick Koston b7d9f26cee Cache the job type for entity service calls (#112793) 2024-03-08 22:49:08 -10:00
Marc Mueller a6b842f818 Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
J. Nick KostonandPaulus Schoutsen d9addc45f9 Avoid scheduling a task to add each entity when not using update_before_add (#110951)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-23 10:49:26 -10:00