1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-29 10:17:08 +00:00

185 Commits

Author SHA1 Message Date
Erik Montnemery
6c2702a7b8
Sort manifests 11 () 2023-02-08 20:10:18 +01:00
J. Nick Koston
0f4b17755e
Improve logging and handling when websocket gets behind ()
fixes undefined
2023-01-29 10:49:27 -10:00
J. Nick Koston
ec3475910f
Improve websocket throughput of state changes ()
After the start event we tend to get an event storm of state
changes which can get the websocket behind.  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 ()
* Enable Ruff SIM105

* Adjust existing cases
2023-01-26 21:06:22 -05:00
Franck Nijhof
5102d1a5f3
Drop Python 3.9 support () 2023-01-22 20:40:33 +01:00
Franck Nijhof
79b52a2b41
Stricter pylint message control () 2023-01-20 13:47:55 +01:00
J. Nick Koston
57239769ba
Only build compressed states once () 2023-01-09 12:07:32 -10:00
Franck Nijhof
8819634b61
String formatting and max line length - Part 6 () 2022-12-24 13:19:51 +01:00
Joakim Sørensen
0dfc0af08c
Add CLOSED as an expected type () 2022-12-03 10:19:16 -05:00
Erik Montnemery
b94e1e9ef8
Fire events when long term statistics is updated ()
* 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__() () 2022-11-23 20:26:55 +01:00
Franck Nijhof
5c99e2e5d3
Improve error logging of WebSocket API () 2022-11-01 14:11:50 -04:00
Paulus Schoutsen
2ef14d60f3
Update pending message error () 2022-10-21 22:47:25 -04:00
Franck Nijhof
bb287dd0ed
Integrations v2.1: Virtual integrations () 2022-10-20 23:09:06 -04:00
Charles Garwood
58d531841b
Fix typo SIGNAL_BOOTSTRAP_INTEGRATONS -> SIGNAL_BOOTSTRAP_INTEGRATIONS () 2022-10-09 17:06:28 -10:00
Franck Nijhof
2b27cfdabb
Set system & entity integration types () 2022-10-04 10:36:42 -04:00
Erik Montnemery
b173ae7f44
Add support for integrations v2 ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-28 11:31:48 -04:00
Franck Nijhof
a19a7e64d5
Fix WebSocket condition testing () 2022-09-16 11:18:00 +02:00
epenet
d8c5d08f90
Expose websocket_api constants in root () 2022-09-12 18:18:37 +02:00
epenet
45a69090f0
Expose and use lovelace constants from root () 2022-09-12 18:10:33 +02:00
Paulus Schoutsen
0e734e629c
Handle missing supported brands () 2022-09-09 07:47:33 +02:00
Lennard Scheibel
35cdad943b
Fix shopping_list service calls not notifying event bus () 2022-09-06 23:18:27 -04:00
J. Nick Koston
f6a03625ba
Implement websocket message coalescing ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-08-24 22:50:48 -05:00
uvjustin
d989e4373d
Remove websocket_api send_big_result () 2022-07-19 21:08:11 -07:00
uvjustin
6b60fb9541
Don't use executor in send_big_result () 2022-07-19 08:40:23 -05:00
J. Nick Koston
61cc9f5288
Consolidate executor jobs when loading integration manifests () 2022-07-14 13:06:08 -07:00
Paulus Schoutsen
41ec8cd354
Expose supported brands via API () 2022-07-12 13:49:54 -07:00
J. Nick Koston
8b067e83f7
Initial orjson support take 3 ()
* Initial orjson support take 2

Still need to work out problem building wheels

--

Redux of  /  Now possible since the following is solved:
 (comment)

This implements orjson where we use our default encoder.  This does not implement orjson where `ExtendedJSONEncoder` is used as these areas tend to be called far less frequently.  If its desired, this could be done in a followup, but it seemed like a case of diminishing returns (except maybe for large diagnostics files, or traces, but those are not expected to be downloaded frequently).

Areas where this makes a perceptible difference:
- Anything that subscribes to entities (Initial subscribe_entities payload)
- Initial download of registries on first connection / restore
- History queries
- Saving states to the database
- Large logbook queries
- Anything that subscribes to events (appdaemon)

Cavets:
orjson supports serializing dataclasses natively (and much faster) which
eliminates the need to implement `as_dict` in many places
when the data is already in a dataclass. This works
well as long as all the data in the dataclass can also
be serialized. I audited all places where we have an `as_dict`
for a dataclass and found only backups needs to be adjusted (support for `Path` needed to be added for backups).  I was a little bit worried about `SensorExtraStoredData` with `Decimal` but it all seems to work out from since it converts it before it gets to the json encoding cc @dgomes

If it turns out to be a problem we can disable this
with option |= [orjson.OPT_PASSTHROUGH_DATACLASS](https://github.com/ijl/orjson#opt_passthrough_dataclass) and it
will fallback to `as_dict`

Its quite impressive for history queries
<img width="1271" alt="Screen_Shot_2022-05-30_at_23_46_30" src="https://user-images.githubusercontent.com/663432/171145699-661ad9db-d91d-4b2d-9c1a-9d7866c03a73.png">

* use for views as well

* handle UnicodeEncodeError

* tweak

* DRY

* DRY

* not needed

* fix tests

* Update tests/components/http/test_view.py

* Update tests/components/http/test_view.py

* black

* templates
2022-06-22 21:59:51 +02:00
J. Nick Koston
c365454afb
Revert "Initial orjson support ()" ()
This was causing the wheels to fail to build. We need
to workout why when we don't have release pressure

This reverts commit d9d22a95563c745ce6a50095f7de902eb078805d.
2022-05-31 13:51:55 -07:00
J. Nick Koston
d9d22a9556
Initial orjson support () 2022-05-31 12:18:11 -07:00
Zac West
20960e182d
Log unknown websocket commands at info instead of error () 2022-05-22 22:41:51 -07:00
J. Nick Koston
9c3f949165
Add live streaming logbook websocket endpoint ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-22 14:57:54 -05:00
Franck Nijhof
c8f700c803
Clean up accessing dispatcher helpers via hass ()
Clean up accessing ditpatcher helpers via hass
2022-05-17 18:41:36 +02:00
J. Nick Koston
78f0716574
Add support for specifying the integrations manifest/list fetches ()
* Add support for specifying the integrations manifest/list fetches

See https://github.com/home-assistant/core/pull/71979 for
the motovation

* Update homeassistant/components/websocket_api/commands.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-17 01:22:56 -05:00
J. Nick Koston
e2cef55162
Add history/history_during_period websocket endpoint () 2022-05-11 17:52:22 -05:00
J. Nick Koston
d612b9e0b4
Reduce event loop overhead for listeners that already queue ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-05 23:09:10 -04:00
Marc Mueller
9b9b553521
Disable no-self-use [pylint] ()
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
J. Nick Koston
fe6a4bfb1d
Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Marc Mueller
53110f8cb7
Update pylint to 2.13.2 () 2022-03-27 16:08:24 +02:00
Marc Mueller
911b159281
Cleanup after pylint update () 2022-03-26 00:34:12 +01:00
Franck Nijhof
15cffbe496
Clean up async_dispatcher_connect helper usage () 2022-03-24 13:19:11 +01:00
J. Nick Koston
ea6da674df
Remove unneeded permissions check from subscribe entities () 2022-03-12 13:30:27 -08:00
J. Nick Koston
68310a426b
Small code quality improvements for subscribe_entities () 2022-03-12 02:07:01 -10:00
J. Nick Koston
0d8f649bd6
Websocket api to subscribe to entities (payloads reduced by ~80%+ vs state_changed events) () 2022-03-11 20:54:49 -08:00
Paulus Schoutsen
fbc39d1206
Log stack trace if exception without message () 2022-03-04 09:48:07 +01:00
Paulus Schoutsen
7f4faafe38
Add type code that is being ignored () 2022-02-26 13:56:47 -08:00
J. Nick Koston
c9e46d360b
Use compact encoding for JSON websocket messages ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-23 22:15:20 -08:00
Paulus Schoutsen
a42547c0e5
Allow get_states to recover () 2022-02-23 21:15:48 -08:00
Paulus Schoutsen
756e711850
Add a new validate config WS command () 2022-02-22 22:28:37 +01:00
Mike Degatano
8ea6cbc257
Support variables in templates with timeout () 2022-02-21 09:56:20 -08:00