Commit Graph

8 Commits (c900e3030b81ed25859911c3c3100713b24cf52b)

Author SHA1 Message Date
Marc Mueller dcca29ef68
Update typing 14 (#48078) 2021-03-18 15:08:35 +01:00
J. Nick Koston 4a3b40a3ef
Ensure websocket event serializer cache is effective if subscription iden differs (#42226)
Since someone websocket subscriptions will use an iden of 2 for
state_changed event (most comment), and some will use another
number for all events, the cache would not be used because the
iden number was different.  We now cache only the event and
use a fast replace to insert the iden number into the serailized
response.
2020-10-23 01:28:22 +02:00
J. Nick Koston f0f817c361
Serialize websocket event message once (#40453)
Since most of the json serialize work for the websocket was done
multiple times for the same message, we can avoid the overhead
of serializing the same message many times (once per websocket
client) with a cache.
2020-09-22 08:47:04 -05:00
springstan 6de8072e8a Move imports to top for websocket_api (#29556)
* Move imports to top for websocket_api

* Move back an import because of circular dependency, add annotations
2019-12-08 12:19:15 +01:00
Ville Skyttä f259ff17d5
Type hint additions (#26831)
* Type hint additions

* Remove optional from sidebar_icon comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Remove optional from sidebar_title comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Fix issues after rebase and mypy 0.730
2019-09-29 20:07:49 +03:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen 429bbc05dc
Add WS subscription command for MQTT (#21696)
* Add WS subscription command for MQTT

* Add test

* Add check for connected

* Rename event_listeners to subscriptions
2019-03-10 20:07:09 -07:00
Paulus Schoutsen 22a80cf733
Break up websocket component (#17003)
* Break up websocket component

* Lint
2018-10-01 11:21:00 +02:00