Commit graph

153 commits

Author SHA1 Message Date
Marc Mueller
87bb7ced79
Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Sid
2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately (#115169) 2024-04-08 10:07:54 -10:00
Sid
6587ee20db
Enable Ruff TRY300 (#114437)
* Enable Ruff TRY300

* Update validation.py

* Address review comments
2024-03-30 10:37:59 +01:00
Steven Looman
eb0aa6bb82
Bump async-upnp-client to 0.38.3 (#114447) 2024-03-29 19:08:07 +01:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston
513da0f71e
Run functions from ssdp listeners immediately (#113634) 2024-03-16 13:52:01 -10:00
J. Nick Koston
620433a79d
Run coroutines as eager tasks in async_run_hass_job (#111683)
* Run coroutines as eager tasks in async_run_hass_job

Note that this does not change async_add_hass_job

Do not merge this. For test run only

* Phase out periodic tasks

* false by default or some tests will block forever, will need to fix each one manually

* kwarg works

* kwarg works

* kwarg works

* fixes

* fix more tests

* fix more tests

* fix lifx

* opensky

* pvpc_hourly_pricing

* adjust more

* adjust more

* smarttub

* adjust more

* adjust more

* adjust more

* adjust more

* adjust

* no eager executor

* zha

* qnap_qsw

* fix more

* fix fix

* docs

* its a wrapper now

* add more coverage

* coverage

* cover all combos

* more fixes

* more fixes

* more fixes

* remaining issues are legit bugs in tests

* make tplink test more predictable

* more fixes

* feedreader

* grind out some more

* make test race safe

* limit first scope to triggers

* one more

* Start tasks eagerly in for async_at_start(ed)

A few of these can avoid being scheduled on the loop
during startup

* fix cloud

* Revert "fix cloud"

This reverts commit 5eb3ce695d.

* fix test to do what start does

* flip flag

* flip flag

* Fix here_travel_time creating many refresh requests at startup

- Each entity would try to refresh the coordinator which
  created many tasks. Move the refresh to a single
  async_at_started

- The tests fired the EVENT_HOMEASSISTANT_START event
  but the code used async_at_started which only worked
  because the tests did not set CoreState to not_running

* fix azure

* remove kw

* remove kw

* rip

* cover

* more rips

* more rips

* more rips
2024-03-11 20:05:08 -04:00
J. Nick Koston
2b0b3c238a
Make SSDP tasks background HassJob to avoid delaying startup (#112668) 2024-03-08 23:11:00 -10:00
Paulus Schoutsen
f416d67d21
Remove built-in support for import_executor in manifest (#112725) 2024-03-08 12:02:32 -05:00
Marc Mueller
930a396712
Add empty line after module docstring [s] (#112704) 2024-03-08 14:33:51 +01:00
J. Nick Koston
f95e5c1196
Use eager tasks in ssdp (#111696)
There are a few places where we are likely to never suspend here
2024-02-28 10:56:07 -05:00
J. Nick Koston
4579de6eb5
Import ssdp in the executor to avoid blocking the event loop (#111593)
`2024-02-26 21:37:59.325 DEBUG (MainThread) [homeassistant.loader] Component ssdp import took 1.179 seconds (loaded_executor=False)`
2024-02-26 23:58:34 -05:00
J. Nick Koston
587854fd59
Remove zeroconf from ssdp after deps (#111326)
* Remove zeroconf from ssdp after deps

This was added in #36277 but is no longer needed since
we setup discovery integrations ahead of time to ensure
their deps are updated before other integrations can load
them

* adjust test
2024-02-26 23:57:41 -05:00
Steven Looman
147a1f7b0b
Bump async-upnp-client to 0.38.2 (#110411) 2024-02-12 15:31:09 -06:00
Steven Looman
2b389739d3
Bump async-upnp-client to 0.38.1 (#108382) 2024-01-19 16:48:08 -10:00
Michael Chisholm
64a2c64419
Bump async-upnp-client to 0.38.0 (#105980) 2023-12-19 10:12:30 -10:00
Steven Looman
39c81cb4b1
Prefer IPv4 locations over IPv6 locations for upnp devices/component (#103792) 2023-11-13 10:09:27 -06:00
Steven Looman
aa9301be32
Bump async-upnp-client to 0.36.2 (#102472) 2023-10-21 10:09:09 -10:00
Steven Looman
ad17f1622c
Bump async-upnp-client to 0.36.1 (#100961) 2023-09-26 16:32:37 -05:00
J. Nick Koston
6387263007
Bump async-upnp-client to 0.36.0 (#100881) 2023-09-25 16:19:40 -05:00
J. Nick Koston
bbcae19d0e
Disable always responding to all SSDP M-SEARCH requests with the root device (#100224) 2023-09-12 17:15:13 -05:00
J. Nick Koston
fc75172d79
Bump async-upnp-client to 0.35.1 (#100248) 2023-09-12 16:35:39 -05:00
J. Nick Koston
bb2cdbe7bc
Change SSDP discovery scan interval to 10 minutes (#99975)
* Change SSDP discovery scan interval to 10 minutes

The first version used a scan interval of 1 minute which we
increased to 2 minutes because it generated too much traffic.

We kept it at 2 minutes because Sonos historicly needed to
get SSDP discovery to stay alive. This is no longer the case
as Sonos has multiple ways to keep from going unavailable:

- mDNS support was added
- We now listen for SSDP alive and good bye all the time
- Each incoming packet from the device keeps it alive now
- We probe when we think the device might be offline

This means it should no longer be necessary to have such a
frequent scan which is a drag on all devices on the network
since its multicast

* adjust tests
2023-09-09 10:54:40 -04:00
J. Nick Koston
d1ac4c9c46
Switch a few ssdp calls to use get_lower (#99931)
get_lower avoids lower casing already lower-cased strings
2023-09-08 13:59:25 -04:00
Steven Looman
045c514c18
Bump async-upnp-client to 0.35.0 (#99129) 2023-08-27 09:08:58 -05:00
Ville Skyttä
b51c0f6ddc
Remove unnnecessary pylint configs from components [s-z]* (#98925) 2023-08-24 01:25:32 +02:00
Steven Looman
9f551c0469
Bump async-upnp-client to 0.34.1 (#97105) 2023-07-23 22:38:21 +02:00
J. Nick Koston
1c814b0ee3
Defer SSDP UPNP server start until the started event (#96555) 2023-07-14 14:28:29 -10:00
Erik Montnemery
8896b27f70
Add empty config schema to integrations p-s (#93700) 2023-05-29 20:57:18 +02:00
Steven Looman
63c2b5868e
Bump async-upnp-client to 0.33.2 (#93329)
* Bump async-upnp-client to 0.33.2

* Fix tests
2023-05-21 17:17:08 -05:00
epenet
c01b1eb013
Adjust async_track_time_interval name argument (#90838)
Adjust async_track_time_interval naming
2023-04-05 10:58:02 -04:00
J. Nick Koston
0cc9b2e803
Use slots for discovery dataclasses (#90751) 2023-04-04 12:44:59 +02:00
J. Nick Koston
02ef7d445d
Allow passing an optional name to async_track_time_interval (#90244)
* Allow passing an optional name to async_track_time_interval

This is the same idea as passing a name to asyncio.create_task which
makes it easier to track down bugs

* more

* short

* still cannot find it

* add a few more

* test
2023-03-25 10:11:14 -04:00
J. Nick Koston
331102e592
Dismiss discoveries when the underlying device disappears (#88340)
* Implement discovery removals

Bluetooth, HomeKit, SSDP, and Zeroconf now implement
dismissing discoveries when the underlying discovered
device disappears

* cover

* add zeroconf test

* cover

* cover bluetooth

* fix rediscover
2023-02-17 15:51:19 -05:00
Erik Montnemery
23fa500406
Sort manifests 9 (#87030) 2023-02-08 20:22:30 +01:00
Steven Looman
7e206b5854
Fix error on empty location in ssdp messages (#86970) 2023-01-30 22:43:58 +01:00
Steven Looman
50373500c3
Ensure a proper scope_id is given for IPv6 addresses when initializing the SSDP component (#86975)
fixes undefined
2023-01-30 22:14:48 +01:00
Steven Looman
a9be2adf06
Actually try port when finding next available port for ssdp server (#84206)
fixes undefined
2022-12-30 15:30:29 +01:00
Steven Looman
682501eb47
Less tasks when receiving SSDP messages (#84186)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-21 11:35:52 -10:00
Michael Chisholm
7378277212
Update async-upnp-client to 0.32.3 (#83215) 2022-12-04 10:05:53 -08:00
Steven Looman
a635e9c9d2
Fix repeating SSDP errors by checking address scope_ids and proper hostname (#81611) 2022-11-05 17:11:59 -05:00
Franck Nijhof
08772004b3
Fix SSDP failure to start on missing URLs (#81453) 2022-11-03 11:13:23 +01:00
Paulus Schoutsen
770aefbd52
SSDP to allow more URLs (#81171)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-10-29 14:26:12 -04:00
Steven Looman
b5f70a404a
Fix SSDP/UPnP server after testing (#80815) 2022-10-24 15:19:19 -05:00
Steven Looman
731f618028
Make home assistant discoverable via UPnP/SSDP (#79820) 2022-10-15 14:00:46 -04:00
Franck Nijhof
2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
Steven Looman
26641fc90d
Bump async-upnp-client to 0.31.2 (#73712) 2022-06-19 12:59:37 -05:00
Steven Looman
2be54de448
Don't verify ssl certificates for ssdp/upnp devices (#73647) 2022-06-17 11:26:25 -05:00
Steven Looman
6c9408aef5
Bump async-upnp-client==0.31.1 (#73135)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-06 11:46:52 -10:00