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
Florian Ludwig
23382ab199
assign user to websocket connection when using legacy_api_password ( #19797 )
2019-01-08 20:45:24 -08:00
Paulus Schoutsen
d1a621601d
No more opt-out auth ( #18854 )
...
* No more opt-out auth
* Fix var
2018-12-02 16:32:53 +01:00
Paulus Schoutsen
df21dd21f2
RFC: Call services directly ( #18720 )
...
* Call services directly
* Simplify
* Type
* Lint
* Update name
* Fix tests
* Catch exceptions in HTTP view
* Lint
* Handle ServiceNotFound in API endpoints that call services
* Type
* Don't crash recorder on non-JSON serializable objects
2018-11-30 21:28:35 +01:00
Paulus Schoutsen
a2386f871d
Forbid float NaN in JSON ( #18757 )
2018-11-28 13:25:23 +01:00
Paulus Schoutsen
9d7b1fc3a7
Enforce permissions for Websocket API ( #18719 )
...
* Handle unauth exceptions in websocket
* Enforce permissions in websocket API
2018-11-27 10:12:31 +01:00
Paulus Schoutsen
2e6346ca43
Break up websocket 2 ( #17028 )
...
* Break up websocket 2
* Lint+Test
* Lintttt
* Rename
2018-10-01 16:09:31 +02:00
Paulus Schoutsen
22a80cf733
Break up websocket component ( #17003 )
...
* Break up websocket component
* Lint
2018-10-01 11:21:00 +02:00