Franck Nijhof and GitHub
91ba35fd1e
Report the original error when removing an entity fails ( #180481 )
2026-08-28 15:59:42 -04:00
epenet and GitHub
b180223baf
Use EntityStateAttribute enum for restored attribute in helpers ( #178238 )
2026-08-19 15:16:12 +02:00
Franck Nijhof and GitHub
1b117651ef
Revert "Add Entity.async_get_recent_context helper" ( #179496 )
2026-08-18 19:18:33 +02:00
3e085fb510
Add Entity.async_get_recent_context helper ( #178425 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2026-08-18 17:30:51 +02:00
ad96b06be6
Add child devices ( #178666 )
...
Co-authored-by: Artur Pragacz <artur@pragacz.com >
2026-08-13 13:53:15 +02:00
Robert Resch and GitHub
77e9fe3a35
Enable ruff rule RUF036 (none-not-at-end-of-union) ( #177543 )
2026-07-29 14:43:38 +02:00
Erik Montnemery and GitHub
cba75b8474
Clear Entity.device_entry when entity is detached from device ( #177445 )
2026-07-28 13:22:32 +02:00
epenet and GitHub
0c4bc95bdd
Migrate base entity attributes to StrEnum ( #174633 )
2026-06-24 15:38:49 +01:00
Abílio Costa and GitHub
dc6269f52d
Add override decorator to remaining homeassistant dir files ( #174488 )
2026-06-22 21:56:03 +02:00
eae809abd1
Fix line length violations in core and helpers ( #170534 )
...
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-14 16:31:01 -04:00
b3eb97adad
Enable ruff RUF046 rule and remove unnecessary int() casts ( #170514 )
...
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-13 23:50:44 +02:00
Artur Pragacz and GitHub
f5fef37210
Remove bind_hass usage ( #168369 )
2026-04-16 15:38:59 +02:00
Erik Montnemery and GitHub
b75af6d84a
Mark Entity.async_write_ha_state as final ( #166627 )
2026-03-30 13:21:45 +02:00
Artur Pragacz and GitHub
151eae4d5a
Add compatibility layer for entities without has_entity_name to entity registry ( #166246 )
2026-03-24 20:22:15 +01:00
epenet and GitHub
5e1a0e2152
Use annotationlib.get_annotations in entity helper ( #165331 )
2026-03-19 15:27:42 +01:00
Ariel Ebersberger and GitHub
eb17367229
Add DomainSpec to trigger and condition helpers ( #165392 )
2026-03-13 19:50:19 +01:00
Artur Pragacz and GitHub
6ac0c163aa
Improve group entities ( #160860 )
2026-03-10 17:34:52 +01:00
Artur Pragacz and GitHub
578a933f30
Move entity name helper to module-level function ( #162766 )
2026-02-11 17:54:53 +01:00
Artur Pragacz and GitHub
c6064f40d2
Use same code path for friendly name as for entity ID ( #161250 )
2026-01-27 00:13:53 +01:00
Artur Pragacz and GitHub
0130919128
Improve entity id generation ( #160302 )
2026-01-14 14:34:52 +01:00
Jan Bouwhuis and GitHub
34d6938171
Fix subentry ID is not updated when renaming the entity ID ( #157498 )
2025-12-01 07:55:13 +01:00
Artur Pragacz and GitHub
36268ffb73
Remove capability_attributes from CalculatedState ( #151672 )
2025-11-10 08:06:02 +01:00
Erik Montnemery and GitHub
dd399ef59f
Refactor EntityPlatform ( #147927 )
2025-07-22 14:35:57 +02:00
Erik Montnemery and GitHub
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
Erik Montnemery and GitHub
91c3b43d7f
Improve comment for helpers.entity.entity_sources ( #146529 )
2025-06-27 20:54:19 +02:00
G Johansson and GitHub
db3090078b
Remove deprecated support feature values in camera ( #146988 )
2025-06-22 09:31:16 +02:00
Erik Montnemery and GitHub
e39edcc234
Remove unused attribute EntityInfo.custom_component ( #146550 )
2025-06-11 17:27:17 +02:00
Joost Lekkerkerker and GitHub
4cd3527761
Enable B009 ( #144192 )
2025-05-21 16:37:51 +01:00
J. Nick Koston and GitHub
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
J. Nick Koston and GitHub
d61e39743b
Reduce ref counting in _async_write_ha_state ( #143634 )
...
* Reduce ref counting in _async_write_ha_state
It no longer makes sense to keep a temp reference
to entity_id and hass since the function was
refactored and there are very few accesses now.
* one more place we can reduce ref counts
2025-04-25 18:25:16 +02:00
J. Nick Koston and GitHub
cb0523660d
Improve error logging when state is too long ( #143636 )
2025-04-24 18:37:32 -10:00
dcc63a6f2e
Bump ruff to 0.10.0 ( #140541 )
...
* Bump ruff to 0.10.0
* Bump ruff to 0.10.0
* Bump ruff to 0.10.0
* Bump ruff to 0.10.0
* Update pyproject.toml
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com >
* Fix
---------
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com >
2025-03-14 12:32:50 +00:00
J. Nick Koston and GitHub
d97194303a
Improve performance of calculating state ( #138832 )
...
```
print(timeit.timeit("x.update(y)", setup=x={a:b}
2025-02-19 09:43:41 +01:00
Ville Skyttä and GitHub
40eb8b91cc
Adjust to recommended propcache.api import paths ( #136150 )
2025-01-21 10:58:22 +01:00
Joost Lekkerkerker and GitHub
8a35261fd8
Remove unused noqas ( #135583 )
2025-01-15 10:02:18 +01:00
Joost Lekkerkerker and GitHub
8db63adc11
Bump ruff to 0.9.1 ( #135197 )
2025-01-14 11:46:12 +01:00
Franck Nijhof and GitHub
00c052bb22
Revert "Remove deprecated supported features warning in ..." (multiple) ( #134933 )
2025-01-07 00:08:02 +01:00
epenet and GitHub
f2500e5a32
Remove deprecated supported features warning in MediaPlayer ( #132365 )
2024-12-09 23:03:55 +01:00
208b14dd2b
Use translations on NumberEntity unit_of_measurement property ( #132095 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com >
2024-12-03 17:08:09 +01:00
Erik Montnemery and GitHub
3e62c6ae2f
Move core config functionality to its own module ( #129065 )
...
* Move core config functionality to its own module
* Adjust test
2024-10-24 13:34:51 +02:00
Erik Montnemery and GitHub
0d447c9d50
Improve entity cached attributes ( #128876 )
2024-10-21 10:29:01 +02:00
J. Nick Koston and GitHub
0f29fd3e10
Switch to using fast cached_property implementation in propcache ( #127339 )
2024-10-03 13:11:02 -05:00
J. Nick Koston and GitHub
e71f6c5948
Small speedup to processing entity customize ( #121271 )
2024-07-05 08:57:08 +02:00
J. Nick Koston and GitHub
cdb2ec4231
Small speed up to entity state calculation ( #121273 )
2024-07-05 08:56:20 +02:00
J. Nick Koston and GitHub
48172b0426
Small speed up to writing entity state ( #121043 )
2024-07-03 12:16:41 -05:00
J. Nick Koston and GitHub
5ae13c2ae2
Make use_device_name a cached_property in the base entity class ( #119758 )
...
There is a small risk that _attr_name or entity_description
would not be set before state was first written, but that
would likely be a bug.
2024-06-18 21:52:36 -04:00
J. Nick Koston and GitHub
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 and GitHub
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 and GitHub
ade0f94a20
Remove duplicate getattr call in entity wrap_attr ( #118558 )
2024-05-31 11:11:46 -04:00
J. Nick Koston and GitHub
e0264c8604
Replace pop calls with del where the result is discarded in entity ( #118340 )
2024-05-28 15:26:53 -10:00