J. Nick Koston
4b7a313ece
Use identity checks for CoreState ( #107846 )
...
Some of the checks used ==, and some used is. Switch
everything to is as its faster
2024-01-12 10:21:26 +01:00
J. Nick Koston
d04e2d56da
Add support for JSON fragments ( #107213 )
2024-01-07 17:36:31 -10:00
J. Nick Koston
44018a4183
Use faster identity checks for SupportsResponse Enum ( #107351 )
2024-01-06 10:12:31 +01:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports ( #107114 )
2024-01-05 11:46:45 +01:00
Erik Montnemery
9eefd95e91
Deduplicate handling of duplicated constants ( #107074 )
...
* Deduplicate handling of duplicated constants
* Use DeprecatedConstant + DeprecatedConstantEnum
* Fixup
* Remove test cases with unnamed tuples
2024-01-04 13:25:09 +01:00
J. Nick Koston
1cbacd13aa
Use identity checks for HassJobType ( #106860 )
2024-01-02 12:33:02 +01:00
J. Nick Koston
9e3869ae1c
Avoid recreating ReadOnly dicts when attributes do not change ( #106687 )
2023-12-29 17:10:40 -10:00
Erik Montnemery
a4e9a053c7
Fix missing await when running shutdown jobs ( #106632 )
2023-12-29 10:04:16 +01:00
Richard Kroegel
bd4177edc8
Add supports_response to ServiceRegistry.register() ( #106164 )
...
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-12-27 13:01:20 +01:00
Robert Resch
fbcb31b103
Deprecate deprecated unit of measurement constants ( #106455 )
2023-12-27 09:04:25 +01:00
Robert Resch
b08268da31
Deprecate deprecated core constants ( #106456 )
2023-12-27 08:42:57 +01:00
Tudor Sandu
636e38f4b3
Trigger Home Assistant shutdown automations right before the stop event instead of during it ( #91165 )
...
Co-authored-by: Erik <erik@montnemery.com>
2023-12-05 11:24:41 -10:00
J. Nick Koston
1522118453
Remove aiohttp cancel on disconnect workaround ( #104175 )
2023-11-29 11:20:36 -07:00
Jan Bouwhuis
487ff8cd7f
Rename ex to exc as name for exceptions ( #104479 )
2023-11-25 08:30:18 +01:00
J. Nick Koston
cc31d77205
Use ulid_now instead of ulid_at_timestamp if no timestamp is passed ( #104226 )
...
* Use ulid_now instead of ulid_at_timestamp if no timestamp is passed
ulid_now is slightly faster than ulid_at_timestamp
* tweak usage
2023-11-19 22:27:24 -05:00
tronikos
9af5e838c6
Add type annotation for service functions with response ( #102813 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-09 12:31:12 +01:00
J. Nick Koston
dca72c598e
Small speed up to async_listen ( #103307 )
...
Avoid constructing an inner function each time we call async_listen
and use a partial which holds a reference to the function body with new
args instead of making another full function
2023-11-03 20:58:03 +01:00
Kevin Stillhammer
06c9719cd6
Support multiple responses for service calls ( #96370 )
...
* add supports_response to platform entity services
* support multiple entities in entity_service_call
* support legacy response format for service calls
* revert changes to script/shell_command
* add back test for multiple responses for legacy service
* remove SupportsResponse.ONLY_LEGACY
* Apply suggestion
Co-authored-by: Allen Porter <allen.porter@gmail.com>
* test for entity_id remove None
* revert Apply suggestion
* return EntityServiceResponse from _handle_entity_call
* Use asyncio.gather
* EntityServiceResponse not Optional
* styling
---------
Co-authored-by: Allen Porter <allen.porter@gmail.com>
2023-11-02 18:37:35 -07:00
J. Nick Koston
b3743937de
Avoid looking up the callable type for HassJob when we already know it ( #102962 )
...
* Avoid looking up the callable type for HassJob when we already know it
When we connect the frontend we call async_listen with run_immediately MANY
times when we already know the job type (it will always be a callback). This
reduces the latency to get the frontend going
* missing coverage
2023-10-30 12:45:22 +01:00
J. Nick Koston
009dc91b97
Fix inner callback decorators with partials ( #102873 )
2023-10-28 08:38:42 -05:00
Erik Montnemery
97cc05d0b4
Make it possible to restart core in safe mode ( #102606 )
2023-10-24 14:47:58 +02:00
Erik Montnemery
c481fdb7d0
Rename safe mode to recovery mode ( #102580 )
2023-10-23 20:33:08 +02:00
Jan Bouwhuis
31bd500222
Make get_channel available as generic helper ( #101721 )
...
* Make get_channel available as generic helper
* Follow up comment
2023-10-10 14:02:32 +02:00
Erik Montnemery
fbcc5318c5
Move attributes to be excluded from recording to entity classes ( #100239 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-20 18:09:12 +02:00
J. Nick Koston
547f32818c
Make core States use cached_property ( #100312 )
...
Need to validate this is worth removing __slots__
2023-09-13 20:33:25 -04:00
Erik Montnemery
6057fe5926
Replace StateMachine._domain_index with a UserDict ( #100270 )
...
* Replace StateMachine._domain_index with a UserDict
* Access the UserDict's backing dict directly
* Optimize
2023-09-13 18:05:17 +02:00
J. Nick Koston
ad4619c038
Speed up serializing event messages ( #100017 )
2023-09-10 08:25:13 -05:00
Marc Mueller
5d54660802
Fix asyncio.wait typing ( #99726 )
2023-09-06 16:53:41 +02:00
Erik Montnemery
7643820e59
Add loader.async_get_loaded_integration ( #99440 )
...
* Add loader.async_get_loaded_integration
* Decorate async_get_loaded_integration with @callback
2023-09-04 14:12:33 +02:00
Erik Montnemery
7c595ee2da
Validate state in template helper preview ( #99455 )
...
* Validate state in template helper preview
* Deduplicate state validation
2023-09-04 14:10:43 +02:00
J. Nick Koston
186e796e25
Speed up fetching states by domain ( #99467 )
2023-09-03 09:30:39 -05:00
J. Nick Koston
1ab2e900f9
Improve lingering timer checks ( #99472 )
2023-09-02 12:43:27 -05:00
Ville Skyttä
6399d74c15
Remove unnnecessary pylint configs from core ( #98704 )
2023-08-22 23:12:12 +02:00
Erik Montnemery
31f5932fe4
Log events with no listeners ( #98540 )
...
* Log events with no listeners
* Unconditionally create the Event object
* Reformat code
2023-08-16 20:14:49 +02:00
Erik Montnemery
91faa53843
Don't allow hass.config.config_dir to be None ( #98442 )
2023-08-16 13:00:14 +02:00
Marc Mueller
a9ade1f84d
Use asyncio.timeout [core] ( #98447 )
2023-08-15 08:36:05 -05:00
Franck Nijhof
868a5f377f
Ruff: isort don't split imports based on trailing comma ( #98162 )
2023-08-10 14:27:03 +02:00
Franck Nijhof
30058297cf
Migrate backported StrEnum to built-in StrEnum ( #97101 )
2023-07-23 23:19:24 +02:00
Marc Mueller
77f38e33e5
Import names from typing instead of typing_extensions [3.11] ( #97065 )
2023-07-22 17:03:44 -05:00
J. Nick Koston
99def97ed9
Add cancel messages to core task cancelation ( #96972 )
2023-07-20 18:03:36 -05:00
J. Nick Koston
08af42b00e
Fix mixed case service schema registration ( #96448 )
2023-07-12 14:39:51 -10:00
Jan Bouwhuis
18ee9f4725
Refactor async_get_hass to rely on threading.local instead of a ContextVar ( #96005 )
...
* Test for async_get_hass
* Add Fix
2023-07-07 14:52:38 -04:00
J. Nick Koston
dc5ee71d7a
Add slots to core EventBus ( #95856 )
2023-07-05 11:47:24 -05:00
J. Nick Koston
ea57f78392
Add slots to the service registry ( #95857 )
2023-07-05 15:59:36 +02:00
J. Nick Koston
b2e708834f
Add slots to the StateMachine class ( #95849 )
2023-07-05 14:00:37 +02:00
J. Nick Koston
91f334ca59
Small cleanups to service calls ( #95873 )
2023-07-05 09:25:38 +02:00
J. Nick Koston
0ff3836083
Use a normal tuple for the EventBus jobs ( #95731 )
2023-07-02 16:35:57 -05:00
Allen Porter
528c206094
Add script specific error messages for `response_variable` ( #95188 )
2023-06-24 21:34:57 -07:00
J. Nick Koston
5059cee53f
Reduce overhead to fire events ( #95163 )
2023-06-24 14:39:13 -05:00
Allen Porter
30e8f806c1
Improve service response data APIs ( #94819 )
...
* Improve service response data APIs
Make the API naming more consistent, and require registration that a
service supports response data so that we can better integrate with
the UI and avoid user confusion with better error messages.
* Improve test coverage
* Add an enum for registering response values
* Assign enum values
* Convert SupportsResponse to StrEnum
* Update service call test docstrings
* Add tiny missing full stop in comment
---------
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-06-20 06:24:31 -07:00