Commit Graph

215 Commits

Author SHA1 Message Date
Ville Skyttä
3094991236 Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
Marc Mueller
a9ade1f84d Use asyncio.timeout [core] (#98447) 2023-08-15 08:36:05 -05:00
Marc Mueller
582499a260 Improve async_track_template_result callback typing (#97135) 2023-07-24 12:42:17 +02:00
J. Nick Koston
dae264f79e Fix websocket_api _state_diff_event using json_encoder_default (#96905) 2023-07-19 18:22:43 +02:00
J. Nick Koston
d242eaa375 Remove the ability to defer websocket message construction (#96734)
This was added in #71364 but all use cases of it were refactored
away so it can now be removed
2023-07-17 08:41:39 +02:00
Erik Montnemery
78880f0c9d Fix execute device actions with WS execute_script (#95783) 2023-07-03 14:21:01 -04:00
J. Nick Koston
2aff138b92 Small improvements to websocket api performance (#95693) 2023-07-02 12:33:25 -05:00
Erik Montnemery
e18f7dffb0 Teach validate_config to validate lists of conditions (#95380)
* Teach validate_config to validate lists of conditions

* Update test
2023-06-27 19:44:23 +02:00
Franck Nijhof
3e85a29b86 Move overlapping pylint rules to ruff, disable mypy overlap (#94359) 2023-06-27 17:42:46 +02:00
Paulus Schoutsen
5f14cdf69d Allow stopping a script with a response value (#95284) 2023-06-27 08:24:22 +02:00
J. Nick Koston
3f18f515e7 Improve websocket api coverage and typing (#94891) 2023-06-20 15:21:24 +01:00
J. Nick Koston
1206f2c1da Fix memory leaks in websocket api (#94780)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-06-19 18:27:22 -05:00
Erik Montnemery
b5f5e1c8c3 Add empty config schema to integrations t-z (#93853) 2023-05-31 10:13:26 +02:00
J. Nick Koston
e1b7d68134 Speed up processing subscribe_events and subscribe_entites when user has read all permissions (#93611)
Speed up processing subscribe_events and subscribe_entites when user the read all permissions
2023-05-27 19:59:46 -04:00
J. Nick Koston
b993fe1c9d Cache generation of the service descriptions (#93131) 2023-05-16 21:42:37 -05:00
J. Nick Koston
99265a983a Speed up reconnects by caching state serialize (#93050) 2023-05-16 02:33:12 -05:00
J. Nick Koston
b95405a7e9 Small performance improvements to state diff messages (#92963)
Adds missing test coverage
2023-05-14 12:28:34 -04:00
J. Nick Koston
2848f8648d Log last message when websocket reaches peak limit (#93038)
When we hit the absolute limit, we would log the last messages as
it was key to finding out the source. We now do the same when
we hit the peak limit
2023-05-14 12:22:19 -04:00
J. Nick Koston
8711735ec0 Improve websocket throughput and reduce latency (#92967) 2023-05-13 00:13:57 +09:00
Erik Montnemery
4e0b8a7363 Allow complex schemas for validating WS commands (#91655) 2023-04-19 11:37:09 -04:00
J. Nick Koston
de2ca31a71 Remove lru_cache on websocket _state_diff (#90392) 2023-03-28 13:08:43 +02:00
J. Nick Koston
e7e7f603c2 Remove async_response from websocket apis where nothing was being awaited (#90204) 2023-03-23 20:53:18 -04:00
Paulus Schoutsen
0ca6723378 Allow passing binary to the WS connection (#89882)
* Allow passing binary to the WS connection

* Expand test coverage

* Test non-existing handler

* Allow signaling end of stream using empty payloads

* Store handlers in a list

* Handle binary handlers raising exceptions
2023-03-22 08:36:36 -04:00
J. Nick Koston
a8e95684fa Fix websocket back pressure bottleneck (#89905) 2023-03-20 21:51:39 -10:00
Michael Hansen
e16f17f5a8 Voice assistant integration with pipelines (#89822)
* Initial commit

* Add websocket test tool

* Small tweak

* Tiny cleanup

* Make pipeline work with frontend branch

* Add some more info to start event

* Fixes

* First voice assistant tests

* Remove run_task

* Clean up for PR

* Add config_flow.py

* Remove CLI tool

* Simplify by removing stt/tts for now

* Clean up and fix tests

* More clean up and API changes

* Add quality_scale

* Remove data from run-finish

* Use StrEnum backport

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-16 20:42:26 -04:00
J. Nick Koston
48b93e03ee Cache transient templates compiles provided via api (#89065)
* Cache transient templates compiles provided via api

partially fixes #89047 (there is more going on here)

* add a bit more coverage just to be sure

* switch method

* Revert "switch method"

This reverts commit 0e9e1c8cbe8753159f4fd6775cdc9cf217d66f0e.

* tweak

* hold hass

* empty for github flakey
2023-03-02 21:31:12 -05:00
J. Nick Koston
ecf87ae979 Improve performance of websocket_api dispatch (#88496)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-02-20 19:51:34 +01:00
Paulus Schoutsen
6cab27f378 Add support for background tasks in HA (#88265)
* Add support for background tasks

* make name mandatory for background tasks

* Update docstring

* async_create_background_task

* Grammar
2023-02-16 20:39:29 -05:00
epenet
ba23816a0c Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01:00
Erik Montnemery
80e2f96097 Add WS command thread/delete_dataset (#88077)
* Add WS command thread/delete_dataset

* Return not_allowed when trying to delete the preferred dataset
2023-02-15 12:55:10 -05:00
Erik Montnemery
6c2702a7b8 Sort manifests 11 (#87032) 2023-02-08 20:10:18 +01:00
J. Nick Koston
0f4b17755e Improve logging and handling when websocket gets behind (#86854)
fixes undefined
2023-01-29 10:49:27 -10:00
J. Nick Koston
ec3475910f Improve websocket throughput of state changes (#86855)
After the start event we tend to get an event storm of state
changes which can get the websocket behind. #86854 will
help with that a bit, but we can reduce the overhead
to build a state diff when the attributes have not
changed
2023-01-28 22:05:06 -05:00
Franck Nijhof
e738924780 Enable Ruff SIM105 (#86759)
* Enable Ruff SIM105

* Adjust existing cases
2023-01-26 21:06:22 -05:00
Franck Nijhof
5102d1a5f3 Drop Python 3.9 support (#85456) 2023-01-22 20:40:33 +01:00
Franck Nijhof
79b52a2b41 Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
J. Nick Koston
57239769ba Only build compressed states once (#85561) 2023-01-09 12:07:32 -10:00
Franck Nijhof
8819634b61 String formatting and max line length - Part 6 (#84525) 2022-12-24 13:19:51 +01:00
Joakim Sørensen
0dfc0af08c Add CLOSED as an expected type (#83180) 2022-12-03 10:19:16 -05:00
Erik Montnemery
b94e1e9ef8 Fire events when long term statistics is updated (#82492)
* Fire events when long term statistics is updated

* Allow the new events to be subscribed to by anyone

* Address review comments

* Finish renaming events

* Finish renaming events

* Fix do_adhoc_statistics

* Adjust tests

* Adjust tests
2022-11-24 22:01:36 +01:00
Jan Bouwhuis
23bc39b7f4 Add type hints on Template().__init__() (#82574) 2022-11-23 20:26:55 +01:00
Franck Nijhof
5c99e2e5d3 Improve error logging of WebSocket API (#81360) 2022-11-01 14:11:50 -04:00
Paulus Schoutsen
2ef14d60f3 Update pending message error (#80763) 2022-10-21 22:47:25 -04:00
Franck Nijhof
bb287dd0ed Integrations v2.1: Virtual integrations (#80613) 2022-10-20 23:09:06 -04:00
Charles Garwood
58d531841b Fix typo SIGNAL_BOOTSTRAP_INTEGRATONS -> SIGNAL_BOOTSTRAP_INTEGRATIONS (#79970) 2022-10-09 17:06:28 -10:00
Franck Nijhof
2b27cfdabb Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
Erik Montnemery
b173ae7f44 Add support for integrations v2 (#78801)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-28 11:31:48 -04:00
Franck Nijhof
a19a7e64d5 Fix WebSocket condition testing (#78570) 2022-09-16 11:18:00 +02:00
epenet
d8c5d08f90 Expose websocket_api constants in root (#78249) 2022-09-12 18:18:37 +02:00
epenet
45a69090f0 Expose and use lovelace constants from root (#78246) 2022-09-12 18:10:33 +02:00