Commit Graph

70 Commits

Author SHA1 Message Date
J. Nick Koston
c9e46d360b Use compact encoding for JSON websocket messages (#67148)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-23 22:15:20 -08:00
Paulus Schoutsen
a42547c0e5 Allow get_states to recover (#67146) 2022-02-23 21:15:48 -08:00
Paulus Schoutsen
756e711850 Add a new validate config WS command (#67057) 2022-02-22 22:28:37 +01:00
Mike Degatano
8ea6cbc257 Support variables in templates with timeout (#66990) 2022-02-21 09:56:20 -08:00
Erik Montnemery
b196064540 Import persistent notification (part 5) (#63902) 2022-01-13 08:45:30 +01:00
Erik Montnemery
6eb0447566 Import websocket_api (part 3) (#63907) 2022-01-11 17:26:37 +01:00
Nico Müller
cf1df5ff38 Add 'fire_event' command to websocket api (#63378)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-01-05 12:28:40 -08:00
Stefan Agner
a13ae85982 Introduce only_supervisor for @websocket_api.ws_require_user() (#61298) 2021-12-08 16:49:35 -08:00
J. Nick Koston
10d6247fee Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Paulus Schoutsen
6d0da631bf Handle prepare timeout in websocket API (#55989) 2021-10-08 22:12:06 -07:00
David Boslee
7f966613bd Disconnect websockets after token is revoked (#57091)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-10-08 09:38:22 -07:00
Erik Montnemery
6954614e62 Warn if total_increasing sensor has negative states (#56564) 2021-09-30 07:49:16 -07:00
Erik Montnemery
bfd799dc04 Use hass_client_no_auth test fixture in integrations s-x (#55585) 2021-09-02 14:50:10 +02:00
Ruslan Sayfutdinov
42ff687c32 Add missing type hints to websocket_api (#50915) 2021-05-21 09:39:18 -07:00
jan iversen
9879b7becf Rename HomeAssistantType to HomeAssistant, integrations w* - z* (#49543)
* Integration zha: HomeAssistantType -> HomeAssistant.

* Integration zerproc: HomeAssistantType -> HomeAssistant.

* Integration xbox: HomeAssistantType -> HomeAssistant.

* Integration wunderground: HomeAssistantType -> HomeAssistant.

* Integration wled: HomeAssistantType -> HomeAssistant.

* Integration water_heater: HomeAssistantType -> HomeAssistant.

* Integration websocket_api: HomeAssistantType -> HomeAssistant.

* Integration wilight: HomeAssistantType -> HomeAssistant.
2021-04-22 11:04:28 -04:00
J. Nick Koston
53853f035d Prevent calling stop or restart services during db upgrade (#49098) 2021-04-12 17:18:38 -07:00
Erik Montnemery
16196e2e16 Don't log template errors from developer tool (#48933) 2021-04-09 12:10:02 -07:00
J. Nick Koston
1f80c756ab Fix subscribe_bootstrap_integrations to send events (#48754) 2021-04-08 07:30:33 -10:00
J. Nick Koston
12e3bc8101 Provide api to see which integrations are being loaded (#48274)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:44 -10:00
Paulus Schoutsen
bdbb4f939f Add variables to execute script (#48613) 2021-04-02 06:27:41 -07:00
Erik Montnemery
40ce25800c Test that homeassistant stop and restart do not block WS (#48081) 2021-03-21 22:12:56 -07:00
Erik Montnemery
333e6a215a Add execute_script WS API (#47964)
* Add execute_script WS API

* Improve tests
2021-03-16 08:51:00 +01:00
Paulus Schoutsen
7fe3c472e9 Improve bad JSON data reporting (#47932)
* Improve bad data reporting

* Fix tests

Co-authored-by: Erik <erik@montnemery.com>
2021-03-15 10:41:25 +01:00
Paulus Schoutsen
4c181bbfe5 Raise error instead of crashing when template passed to call service target (#47467) 2021-03-05 15:34:18 -08:00
Bram Kragten
4b493c5ab9 Add target to service call API (#45898)
* Add target to service call API

* Fix _async_call_service_step

* CONF_SERVICE_ENTITY_ID overrules target

* Move merging up before processing schema

* Restore services.yaml

* Add test
2021-02-10 12:42:28 +01:00
Marc Mueller
fb39185420 Add schema error handling to websocket_api (#45602)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-27 15:20:22 +01:00
Franck Nijhof
65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen
7a85b3ea66 Add test to access current request in websocket API (#43133) 2020-11-13 14:20:47 +01:00
Paulus Schoutsen
de12ac354a Expose more Websocket API constants (#42263) 2020-10-25 21:10:13 +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
31c21126a8 Implement time tracking in templates (#41147)
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-10-19 11:02:43 +02:00
J. Nick Koston
b897ca7260 Ensure all template errors are caught and the websocket api reports them (#41719) 2020-10-12 16:38:24 +02:00
J. Nick Koston
4798f37c6e Convert States to dicts via as_dict only once (#41208)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-05 09:18:57 -05:00
J. Nick Koston
e08ee282ab Abort execution of template renders that overwhelm the system (#40647) 2020-09-28 14:43:22 +02:00
J. Nick Koston
57b7559832 Ensure all jinja2 errors are trapped and displayed in the developer tools (#40624)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-26 17:03:32 -05: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
J. Nick Koston
741487a1fc Return the listeners with the template result for the websocket api (#39925) 2020-09-11 13:18:40 -05:00
Paulus Schoutsen
2a1fe9d29a Add websocket trigger/condition commands (#39109) 2020-08-24 23:01:57 +02:00
J. Nick Koston
f560256546 Update websocket api to use async_track_template_result (#39057) 2020-08-21 14:04:29 +02:00
Paulus Schoutsen
3dc79aa60a Track entity sources (#37258)
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2020-08-19 14:57:38 +02:00
Paulus Schoutsen
8ed1a29c82 Drop white blacklist pt1 (#37816) 2020-07-13 17:43:11 +02:00
Aaron Bach
7968cd650a Add concept of allowed external URLs to config (#36988)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-24 17:37:01 -07:00
Paulus Schoutsen
276f3afb00 Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Paulus Schoutsen
2af984917e Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen
ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen
9f1bffe3be Add command to get integration manifests (#34262)
* Add command to get integration manifests

* Add is_built_in value to manifest

* Update APIs
2020-04-15 13:36:16 -07:00
Paulus Schoutsen
d93c09327a Report unserializable data in websocket (#34072)
* Report unserializable data in websocket

* Fix tests

* log types too
2020-04-13 23:46:41 -07:00
Paulus Schoutsen
bea354b82a Allow WS queue to temporarily peak (#34175)
* Allow WS queue to temporarily peak

* Remove unused code
2020-04-13 18:50:36 -07:00
Ville Skyttä
e6388e186c Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Franck Nijhof
4e7b35355d Migrate websocket_api tests from coroutine to async/await (#30364) 2020-01-01 17:15:29 -06:00