Commit Graph

2149 Commits (6d457e808f1229c565341200c97aa10a062791eb)

Author SHA1 Message Date
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
J. Nick Koston 8af7475f73
Set TriggerBaseEntity device_class in init (#100216) 2023-09-12 19:36:56 +02:00
J. Nick Koston 3b8d99dcd8
Add __slots__ to translation cache (#100069) 2023-09-10 20:46:55 +02:00
Erik Montnemery 1654ef7759
Make WS command render_template not give up if initial render raises (#99808) 2023-09-08 21:02:06 +02:00
J. Nick Koston bd1d8675a9
Avoid many hass.is_stopping calls in the discovery helper (#99929)
async_has_matching_flow is more likely to be True than hass.is_stopping

This does not make much difference but it was adding noise to a profile
that I am digging into to look for another issue
2023-09-08 13:09:29 -04:00
J. Nick Koston 3d403c9b60
Refactor entity service calls to reduce complexity (#99783)
* Refactor entity service calls to reduce complexity

gets rid of the noqa C901

* Refactor entity service calls to reduce complexity

gets rid of the noqa C901

* short
2023-09-08 13:04:53 -04:00
Erik Montnemery eee5705458
Fix typo in TrackTemplateResultInfo (#99809) 2023-09-07 13:00:26 +02:00
Erik Montnemery c9a6ea94a7
Send template render errors to template helper preview (#99716) 2023-09-06 16:07:05 +02:00
J. Nick Koston 034fabe188
Use loop time to set context (#99701)
* Use loop time to set context

loop time is faster than utcnow, and since its only used internally it can
be switched without a breaking change

* fix mocking
2023-09-06 11:04:49 +02:00
Erik Montnemery 48f7924e9e
Allow specifying a custom log function for template render (#99572)
* Allow specifying a custom log function for template render

* Bypass template cache when reporting errors + fix tests

* Send errors as events

* Fix logic for creating new TemplateEnvironment

* Add strict mode back

* Only send error events if report_errors is True

* Force test of websocket_api only

* Debug test

* Run pytest with higher verbosity

* Timeout after 1 minute, enable syslog output

* Adjust timeout

* Add debug logs

* Fix unsafe call to WebSocketHandler._send_message

* Remove debug code

* Improve test coverage

* Revert accidental change

* Include severity in error events

* Remove redundant information from error events
2023-09-06 10:03:35 +02:00
Erik Montnemery cdca4591a4
Include template listener info in template preview (#99669) 2023-09-06 09:49:42 +02:00
J. Nick Koston a2dae60170
Refactor dispatcher to reduce run time and memory overhead (#99676)
* Fix memory leak in dispatcher removal

When we removed the last job/callable from the dict for the
signal we did not remove the dict for the signal which meant
it leaked

* comment

* cleanup a bit more
2023-09-05 21:18:27 -04:00
Erik Montnemery de73cafc8b
Small cleanup of TemplateEnvironment (#99571)
* Small cleanup of TemplateEnvironment

* Fix typo
2023-09-04 22:19:40 +02:00
Erik Montnemery 709ce7e0af
Set state of entity with invalid state to unknown (#99452)
* Set state of entity with invalid state to unknown

* Add test

* Apply suggestions from code review

Co-authored-by: Robert Resch <robert@resch.dev>

* Update test_entity.py

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-04 14:09:51 +02:00
J. Nick Koston 5f487b5d85
Refactor async_call_at and async_call_later event helpers to avoid creating closures (#99469) 2023-09-03 08:19:06 -05:00
Allen Porter 7b1c0c2df2
Extend template entities with a script section (#96175)
* Extend template entities with a script section

This allows making a trigger entity that triggers a few times a day,
and allows collecting data from a service resopnse which can be
fed into a template entity.

The current alternatives are to publish and subscribe to events or to
store data in input entities.

* Make variables set in actions accessible to templates

* Format code

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-09-02 16:19:45 -07:00
Erik Montnemery 691bbedfc8
Fix typo in TrackTemplateResultInfo (#99276) 2023-08-29 08:54:38 -05:00
J. Nick Koston 0e6b3d6583
Switch async_track_same_state to use async_call_later (#99219)
* Switch async_track_same_state to use async_call_later

There was no need to use async_track_point_in_utc_time here since
we only need a delay

* update trigger tests

* remove some more utcnow patching

* remove some more utcnow patching

* remove some more utcnow patching
2023-08-28 22:30:20 +02:00
J. Nick Koston 80d2309896
Switch async_track_time_interval to use async_call_later internally (#99220) 2023-08-28 13:56:22 -05:00
Erik Montnemery 9dac6a2948
Use loop.time in DataUpdateCoordinator (#98937) 2023-08-28 10:16:34 -05:00