Commit Graph

66 Commits (4d39a85553d2fd913c9d343680a6bfd970435da0)

Author SHA1 Message Date
Marc Mueller c82933175d
Use builtin TimeoutError [a-d] (#109678) 2024-02-05 11:31:33 +01:00
Jan-Philipp Benecke 0a0d4c37a9
Use constants instead of literals for api (#105955) 2024-01-29 18:09:00 +01:00
J. Nick Koston 8c71abe421
Avoid json encoder default fallback for APIComponentsView (#108359) 2024-01-19 13:44:29 +01:00
Marc Mueller 15bd31e8d8
Enable strict typing for api (#108363) 2024-01-19 13:33:20 +01:00
Marc Mueller 25b7bb4a4f
Adjust require_admin decorator typing (#108306)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-18 14:12:14 -10:00
Marc Mueller 7c6fe31505
Improve api typing (#108307) 2024-01-18 12:45:15 -10:00
J. Nick Koston 60ab360fe7
Avoid bytes to string to bytes conversion in websocket api (#108139) 2024-01-16 21:37:34 +01:00
J. Nick Koston d04e2d56da
Add support for JSON fragments (#107213) 2024-01-07 17:36:31 -10:00
J. Nick Koston dfed10420c
Remove aiohttp enable_compression helper (#104174) 2023-11-29 10:24:34 -07:00
Martin Hjelmare e884933dbd
Remove rest api service call timeout (#104709) 2023-11-29 14:46:19 +01:00
J. Nick Koston 0d63e2f9b5
Ensure large payloads are compressed in the executor with aiohttp 3.9.0 (#103592) 2023-11-07 12:37:54 -06:00
Denis Shulyaka d18b2d8748
Shield service call from cancellation on REST API connection loss (#102657)
* Shield service call from cancellation on connection loss

* add test for timeout

* Apply suggestions from code review

* Apply suggestions from code review

* fix merge

* Apply suggestions from code review
2023-11-02 12:58:26 +01:00
J. Nick Koston 78e546b35a
Avoid enumerating the whole state machine on api service calls (#103147) 2023-11-01 10:25:02 +01:00
J. Nick Koston 547f32818c
Make core States use cached_property (#100312)
Need to validate this is worth removing __slots__
2023-09-13 20:33:25 -04:00
J. Nick Koston 5e81499855
Avoid json_decoder_fallback in /api/states (#100018) 2023-09-10 08:25:23 -05:00
Erik Montnemery 368acaf6fd
Improve error handling in /api/states POST (#99810) 2023-09-07 13:33:38 +02:00
J. Nick Koston d2a52230ff
Speed up responding to states being polled via API (#99621)
* Speed up responding to states being polled via API

Switch to using `as_dict_json` to avoid serializing states over and over when the
states api is polled since the mobile app is already building the cache as it also
polls the states via the websocket_api

* Speed up responding to states being polled via API

Switch to using `as_dict_json` to avoid serializing states over and over when the
states api is polled since the mobile app is already building the cache as it also
polls the states via the websocket_api

* fix json

* cover
2023-09-04 16:51:19 -04:00
J. Nick Koston acd9cfa929
Speed up calls to the all states api (#99462) 2023-09-02 12:08:07 -05:00
J. Nick Koston 262483f3f6
Replace async_timeout with asyncio.timeout A-B (#98415) 2023-08-15 10:29:28 +02:00
Robert Resch b0f68f1ef3
Use @require_admin decorator (#98061)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-14 15:07:20 +02:00
J. Nick Koston 29aa89bea0
Add lightweight API to get core state (#96860) 2023-07-19 20:31:48 +02:00
Erik Montnemery 8053073a77
Add empty config schema to integrations a-c (#93608) 2023-05-29 14:38:33 -04:00
J. Nick Koston 48b93e03ee
Cache transient templates compiles provided via api (#89065)
* Cache transient templates compiles provided via api

partially fixes #89047 (there is more going on here)

* add a bit more coverage just to be sure

* switch method

* Revert "switch method"

This reverts commit 0e9e1c8cbe.

* tweak

* hold hass

* empty for github flakey
2023-03-02 21:31:12 -05:00
epenet ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01:00
Erik Montnemery 231aad7a68
Sort manifests 1 (#87022) 2023-02-08 20:29:44 +01:00
Franck Nijhof 2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
J. Nick Koston 6c41a10142
Switch api and event stream to use json helper (#73868) 2022-06-22 20:13:02 -05:00
Marc Mueller 9b9b553521
Disable no-self-use [pylint] (#70641)
* 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 (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Joakim Sørensen 04c5e51cbd
Remove the deprecated discovery_info endpoint (#64534) 2022-01-20 13:46:48 +01:00
epenet 6a67143732
Add setup type hints [a] (#63424)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-05 14:15:57 +01:00
J. Nick Koston 10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Marc Mueller 2b72b7b7b9
Use assignment expressions 09 (#57790) 2021-10-17 20:19:56 +02:00
Ville Skyttä d8d34fdd3b
Prefer HTTPStatus over int in HA view JSON functions (#56504)
* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
2021-09-22 21:59:52 +03:00
Marc Mueller 48bada5a18
Update pylint to 2.11.1 (#56364) 2021-09-18 13:52:59 +02:00
Joakim Sørensen bcb3c426f4
Blank out discovery info (#56097) 2021-09-11 12:34:19 -07:00
Franck Nijhof 13c34d646f
Remove empty currency from discovery info (#54478) 2021-08-11 08:09:16 -07:00
Franck Nijhof 1968b95829
Add currency core configuration (#53541)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-07-28 08:55:58 +02:00
Franck Nijhof 6932cf9534
Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
Paulus Schoutsen ff94e920e4
Do not use AsyncTrackStates (#47255) 2021-03-11 23:18:09 -08:00
Bram Kragten e3105c7eb1
Revert CORS changes for my home assistant (#47064)
* Revert CORS changes for my home assistant

* Update test_init.py

* Update test_init.py
2021-02-25 15:28:22 -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
Paulus Schoutsen e27619fe50
Allow discovery info accessible from CORS enabled domains (#46226) 2021-02-08 17:19:55 +01:00
Paulus Schoutsen 3a17e22cfa
Convert API integration to async setup (#43685) 2020-11-27 09:50:19 +01:00
Franck Nijhof 45aba9bdf2
Allow skip parsing template result (#42401) 2020-10-26 16:01:09 +01:00
Franck Nijhof ee914366a8
Add native Python types support to templates (#41227)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-10-07 00:05:52 +02:00
Joakim Sørensen 4a63b83caa
Add installation type to discovery endpoint (#40585) 2020-09-26 09:17:04 +02:00
Ville Skyttä b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof ddb5ed9dc8
Add more information to discovery API (#35624) 2020-05-15 13:29:55 +02:00
springstan 8d61893c39
Use HTTP_OK constant (#33798)
* Use http ok constant

* Remove incorrect use

* Run isort

* Fix pylint by adding missing imports

* Fix pylint by fixing one import
2020-04-08 11:47:38 -05:00