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
Bas Nijholt
3df40c7a16
Sort imports according to PEP8 for websocket_api ( #29657 )
2019-12-09 12:30:23 +01:00
Paulus Schoutsen
3231e22ddf
Remove direct authentication via trusted networks or API password ( #27656 )
...
* Remove direct authentication via trusted networks and API password
* Fix tests
2019-10-14 14:56:45 -07:00
Thomas Lovén
e7e083c547
Websocket call for rendering jinja2 templates subscription ( #25614 )
...
* Websocket call for rendering jinja2 templates
* Address review comments
* Address review comments
* Allow MATCH_ALL, but ignore it.
* Always register unsub method.
2019-08-10 12:46:49 -07:00
Paulus Schoutsen
4de97abc3a
Black
2019-07-31 12:25:30 -07:00
Paulus Schoutsen
f995ab9d54
Don't pass in loop ( #23984 )
...
* Don't pass in loop
* Revert some changes
* Lint + Axis revert
* reinstate loop
* Fix a test
* Set loop
* Update camera.py
* Lint
2019-05-22 21:09:59 -07:00
Paulus Schoutsen
de1fd5a7fa
WS: Improve service calling errors ( #23840 )
...
* WS: Improve service calling errors
* Docstyle
* Types
* Update text
2019-05-14 07:09:11 +02:00
Paulus Schoutsen
45085dd97f
Better handle large amounts of data being sent over WS ( #23842 )
...
* Better handle large amounts of data being sent over WS
* Lint
2019-05-14 05:57:47 +02:00
Leonardo Merza
29ad3961e5
Use voluptuous error string for websocket validation error ( #21883 )
...
* use voluptuous error string to websocket validation error
* added exception logging to websocket error
* add detailed message to websocket validation error
* add error message to websocket validation error
* Add humanize error for websocket invalid vol error
* Add humanize error for websocket invalid vol error
* Add humanize error for websocket invalid vol error
2019-03-27 10:40:39 -07:00
Penny Wood
1ddc65a0ce
Fixing the api_streams sensor ( #22200 )
...
* Fire events with websocket messages.
* Added tests to validate
* Fixed api_streams sensor to use new sensor
* Delete from coverageac as now works.
* Removed websocket request event.
* Use dispatcher instead of events.
* Moved sensor to under websocket_api
* Changes as per code review
* Fixed tests.
* Modified test
* Patch
2019-03-22 11:59:10 -07:00
Paulus Schoutsen
29131a655d
Allow non-admins to listen to certain events ( #22137 )
2019-03-17 19:13:06 -07:00
Jason Hu
fe1840f901
Deprecate http.api_password ( #21884 )
...
* Deprecated http.api_password
* Deprecated ApiConfig.api_password
GitHub Drafted PR would trigger CI after changed it to normal PR.
I have to commit a comment change to trigger it
* Trigger CI
* Adjust if- elif chain in auth middleware
2019-03-10 19:55:36 -07:00
Paulus Schoutsen
fc1ee9be43
Use new style for built-in ws commmands ( #21694 )
...
* Use new style for built-in ws commmands
* Lint
2019-03-05 19:31:26 -08:00
Jason Hu
f1b867dccb
Re-thrown exception occurred in the blocking service call ( #21573 )
...
* Rethrown exception occurred in the actual service call
* Fix lint and test
2019-03-01 23:09:31 -08:00