Commit graph

14 commits

Author SHA1 Message Date
Jan-Philipp Benecke
39e720caed
Use debug/warning instead of info log level in components [t] (#126147) 2024-09-18 12:39:50 +02:00
epenet
9ca398ef82
Improve type hints in webhook implementations (#121588) 2024-07-09 12:05:23 +02:00
Marc Mueller
062cc4bfce
Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Joakim Plate
8910d265d6
Keep track of a context for each listener (#72702)
* Remove async_remove_listener

This avoids the ambuigity as to what happens if same callback is added multiple times.

* Keep track of a context for each listener

This allow a update coordinator to adapt what data to request on update from the backing service based on which entities are enabled.

* Clone list before calling callbacks

The callbacks can end up unregistering and modifying the dict while iterating.

* Only yield actual values

* Add a test for update context

* Factor out iteration of _listeners to helper

* Verify context is passed to coordinator

* Switch to Any as type instead of object

* Remove function which use was dropped earliers

The use was removed in 8bee25c938
2022-06-03 13:55:57 +02:00
Erik Montnemery
d4497e4b68
Make toon fall back to webhooks if cloud is not available (#64981) 2022-01-26 11:06:47 -08:00
epenet
6a6cdef725
Import webhook in toon (#64544)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-20 12:04:47 +01:00
epenet
2c0033254b
Import cloud (#64116)
* Add type hints to cloud

* Import cloud

* Adjust smartthings tests

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-14 16:35:35 +01:00
Michael
9eecd90afc
Add constructor return type in integrations T-Z (#50899) 2021-05-20 17:00:19 +02:00
Marc Mueller
b67b9b94f9
Update typing 13 (#48077) 2021-03-18 14:43:52 +01: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
ecf22198c5
Ensure Toon webhook ID isn't registered on re-registration (#38376) 2020-07-30 21:37:34 +02:00
Ville Skyttä
c2a21fa496
Update coordinator improvements (#38366)
* Make generic

* Add type info to bunch of uses

* Recognize requests exceptions

* Recognize urllib exceptions
2020-07-30 18:04:00 +03:00
Franck Nijhof
8b21b415c4
Fix/Rewrite of Toon integration (#36952)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 18:22:41 -07:00