Commit graph

2168 commits

Author SHA1 Message Date
J. Nick Koston
68471b6da5
Reduce template render overhead (#103343)
The contextmanager decorator creates a new context manager every
time its run, but since we only have a single context var, we can
use the same one every time. Creating the contextmanager was roughly
20% of the time time of the template render

I was a bit suprised to find it creates a new context manager
object every time https://stackoverflow.com/questions/34872535/why-contextmanager-is-slow
2023-11-04 09:46:01 +01:00
Erik Montnemery
0ea0a1ed06
Prevent accidentally reusing an entity object (#102911)
* Prevent accidentally reusing an entity object

* Fix group reload service

* Revert "Fix group reload service"

* Improve test

* Add tests aserting entity can't be reused
2023-11-03 21:01:38 +01:00
Paul Bottein
89a9e6c6e8
Add trigger selector for blueprint (#103050) 2023-11-03 09:11:49 +01:00
Erik Montnemery
a63c420890
Quote entity ids in entity excpetions (#103286) 2023-11-03 06:04:07 +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
a7183a0cbf
Allow missing components in safe mode (#102891) 2023-10-27 13:26:26 +02:00
Erik Montnemery
294f565bad
Allow missing components in safe mode (#102888) 2023-10-27 12:25:27 +02:00
Erik Montnemery
9ea97fd8d2
Improve docstrings for time related event helpers (#102839)
* Improve docstrings for time related event helpers

* Fix grammar

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-26 14:00:44 +02:00
Raman Gupta
35d18a9a3e
Add tests for types and functions for type conversions in templates (#100807)
Co-authored-by: Robert Resch <robert@resch.dev>
2023-10-25 13:20:34 +02:00
J. Nick Koston
f91583a0fc
Add support for family to aiohttp session helper (#102702) 2023-10-24 18:40:39 -05:00
Allen Porter
5d430f53cd
Add todo component (#100019) 2023-10-23 22:53:00 +02:00
Erik Montnemery
c481fdb7d0
Rename safe mode to recovery mode (#102580) 2023-10-23 20:33:08 +02:00
Erik Montnemery
1621310ba7
Add serial_number to device registry entries (#102334)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-22 15:14:44 +02:00
Erik Montnemery
dff18b4a16
Rename gather_with_concurrency to gather_with_limited_concurrency (#102241)
* Rename gather_with_concurrency to gather_with_limited_concurrency

* Update test
2023-10-19 15:08:52 +02:00
J. Nick Koston
e2e9c84c88
Cache construction of battery icon (#102194)
This was being built every time state was written. When
a robo vac is operating it writes state often which mean building
the icon string over and over again when it rarely changes.
2023-10-18 07:35:39 +02:00
J. Nick Koston
433c022687
Save previous unique id in entity registry when it changes (#102093) 2023-10-16 21:26:19 -10:00
Michael Hansen
25671a2e42
Add HassNevermind intent (bump intents package) (#102131)
* Add HassNevermind intent

* Bump intents package to 2023.10.16
2023-10-16 19:13:26 -05:00
J. Nick Koston
e5ebdf7ad4
Remove implict name check from Entity base class (#101905) 2023-10-15 23:40:43 +02:00
J. Nick Koston
7b2aa3a369
Improve performance of config/entity_registry/get* calls (#101984) 2023-10-14 08:40:16 -10:00
Marc Mueller
02567d9bf6
Revert aiohttp to 3.8.5 for Python 3.11 (#101932) 2023-10-13 14:12:42 +02:00
G Johansson
dc29190564
CountrySelector (#100963)
* CountrySelector

* rename

* remove multiple for now

* Add no_sort

* Update homeassistant/helpers/selector.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-12 16:44:30 +02:00
Marc Mueller
0b2b486754
Update mypy to 1.6.0 (#101780) 2023-10-11 13:25:11 +02:00
Robert Resch
b932c67eb7
Delete optional schema keys, when they are not present (#101755)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-10 21:08:54 +02:00
Nicolas van de Walle
1b11062b27
Improved debugging for "Failed to set state" (#101657) 2023-10-08 19:40:42 +02:00
Joost Lekkerkerker
faea3b1634
Abort config flow when invalid token is received (#101642) 2023-10-08 13:32:35 +02:00
Marc Mueller
3155e62510
Update aiohttp to 3.9.0b0 (#101627) 2023-10-08 13:21:46 +02:00
Erik Montnemery
3478666973
Use loader.async_suggest_report_issue in deprecation helper (#101393) 2023-10-06 09:51:08 +02:00
Erik Montnemery
dce5099d92
Use loader.async_suggest_report_issue in frame helper (#101461) 2023-10-05 19:52:26 +02:00
Erik Montnemery
7e39acda37
Minor improvement of frame helper (#101387)
* Minor improvement of frame helper

* Add new custom integration for testing

* Make IntegrationFrame kw_only
2023-10-04 21:43:00 +02:00
Erik Montnemery
17779c5f0c
Add loader.async_suggest_report_issue and loader.async_get_issue_tracker (#101336)
* Add loader.async_suggest_report_issue and loader.async_get_issue_tracker

* Update tests

* Add tests

* Address review comments

* Address review comments
2023-10-04 13:40:33 +02:00
Ville Skyttä
5551a345ea
Remove some unnecessary uses of regular expressions (#101182) 2023-10-03 20:55:00 -05:00
Erik Montnemery
ab2de18f8f
Refactor frame.get_integration_frame (#101322) 2023-10-03 19:21:27 +02:00
Dave T
99a76ef4e6
Fix most sphinx documentation warnings (#101228) 2023-10-02 09:01:41 +02:00
Ville Skyttä
f4bf8fa8f1
Catch HTML case insensitively in "no HTML" config validation (#101181) 2023-10-01 16:19:24 +02:00
Erik Montnemery
47ecce4873
Allow deleting entity entries from entity_registry.async_migrate_entries (#101094)
* Allow deleting entity entries from entity_registry.async_migrate_entries

* Explicitly return None in tests
2023-09-30 10:23:10 +02:00
Erik Montnemery
ab060b86d1
Remove async_process_integration_platform_for_component (#100680) 2023-09-21 17:06:41 +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
Erik Montnemery
d1afcd773f
Revert "Cache entity properties that are never expected to change in the base class" (#100422)
Revert "Cache entity properties that are never expected to change in the base class (#95315)"

This reverts commit 042776ebb8.
2023-09-15 11:25:24 +02:00
J. Nick Koston
042776ebb8
Cache entity properties that are never expected to change in the base class (#95315) 2023-09-14 17:48:48 -05:00
Joakim Plate
5f20725fd5
Remove _next_refresh variable in update coordinator (#100323)
* Remove _next_refresh variable

* Adjust tomorrowio
2023-09-14 22:32:50 +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
J. Nick Koston
fe5eba9b31
Use cached_property in device registry (#100309) 2023-09-13 15:36:07 -05:00
J. Nick Koston
877eedf6d7
Use cached_property in entity_registry (#100302) 2023-09-13 14:38:40 -05:00
Erik Montnemery
c3d1cdd0e9
Improve UserDict in device and entity registries (#100307) 2023-09-13 11:09:34 -05:00
Erik Montnemery
684b2d4537
Improve type hint in entity_registry (#100278) 2023-09-13 12:42:06 +02:00
Erik Montnemery
bbcbb2e322
Improve Entity._suggest_report_issue (#100204) 2023-09-12 21:07:32 +02:00
Erik Montnemery
09ad1a9a36
Remove unnecessary block use of pylint disable in components p-z (#100192) 2023-09-12 20:47:48 +02:00
Erik Montnemery
51576b7214
Improve typing of entity.entity_sources (#99407)
* Improve typing of entity.entity_sources

* Calculate entity info source when generating WS response

* Adjust typing

* Update tests
2023-09-12 20:41:26 +02:00