Commit Graph

56 Commits (2b2275dfb38ad438dc0e98dae62fd5665d52a231)

Author SHA1 Message Date
Steven Looman 731f618028
Make home assistant discoverable via UPnP/SSDP (#79820) 2022-10-15 14:00:46 -04:00
Steven Looman d550b17bd9
Use identifiers host and serial number to match device (#75657) 2022-09-06 11:33:16 -04:00
Paulus Schoutsen 525afb729c
Disable some upnp entities by default (#77330) 2022-08-25 23:45:27 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Steven Looman bf15df75dd
Ignore fake upnp/IGD devices when upnp is discovered (#73645) 2022-06-17 11:26:45 -05:00
epenet 640f53ce21
Remove YAML configuration from upnp (#72410) 2022-05-30 17:07:18 +02:00
Steven Looman 2e36a79357
Changes after late upnp review (#72241)
* Changes after review of #70008, part 1

* Changes after review from #70008

* Revert to UpnpDataUpdateCoordinator._async_update_data
2022-05-24 21:37:37 +02:00
Steven Looman bddfbe01f3
Better handle devices changing UDN and/or location in upnp component (#70008) 2022-04-20 11:01:43 -10:00
Steven Looman 0d6d8a17e3
Drop upnp options flow (#69134) 2022-04-12 14:10:54 -07:00
Paulus Schoutsen d753f4a2e7
Fix UPNP access to SSDP info (#65728) 2022-02-04 21:33:53 -08:00
Paulus Schoutsen 3c250ecf43
Fix flaky upnp test (#64656) 2022-01-21 11:20:43 -08:00
Erik Montnemery 07e10c645b
Attempt to fix flaky upnp test (#64617)
* Attempt to fix flaky upnp test

* Remove unused constant

* Correct test changes

* Correct test changes
2022-01-21 17:27:07 +01:00
Marc Mueller d057850971
Update typing - collections.abc (3) (#63947) 2022-01-12 08:04:17 +01:00
Marc Mueller ef7316d8d9
Update typing (5) [tests] (#63926) 2022-01-11 21:28:13 +01:00
Steven Looman 9bf1397c54
Fix upnp device not being reinitialized after device changes location (#63133) 2022-01-07 14:10:11 +01:00
epenet 7a098cff1c
Use dataclass properties in upnp discovery (#60744)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 09:23:38 -10:00
epenet 22bdd38583
Use SsdpServiceInfo for SOURCE_SSDP tests (part 4) (#60339)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 17:13:52 -06:00
Michael af8e1143b9
Fix slow config_flow test in upnp (#60377) 2021-11-26 00:07:23 +01:00
Erik Montnemery 953ad71d22
Fix flaky UPNP test (#58493) 2021-10-26 13:35:09 -07:00
Steven Looman b75f1b8951
Fix broken upnp derived sensors reporting b/s instead of kb/s (#57681) 2021-10-15 13:03:03 -07:00
Steven Looman 73260c5b88
Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client

* Fix test for environments with multiple sources

* Fix sonos tests

* More fixes/changes

* More fixes

* Use async_upnp_client==0.21.0

* Pylint/test fixes

* More changes after review

* Fix tests

* Improve testing

* Fix mypy

* Fix yamaha_musiccast tests?

* Changes after review

* Pylint

* Reduce calls to combined_headers

* Update to async_upnp_client==0.21.1

* Update to async_upnp_client==0.21.2

* use as_dict

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-11 13:38:16 -10:00
ehendrix23 4310a7d814
Add upnp sensor for IP, Status, and Uptime (#54780)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-09-03 17:15:28 +02:00
Erik Montnemery 7dbe8070f7
Mock out network.util.async_get_source_ip in tests (#55592) 2021-09-02 20:44:50 +02:00
ehendrix23 8bf79d61ee
Add upnp binary sensor for connectivity status (#54489)
* New binary sensor for connectivity

* Add binary_sensor

* New binary sensor for connectivity

* Add binary_sensor

* Handle values returned as None

* Small text update for Uptime

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Updates based on review

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Further updates based on review

* Set device_class as a class atribute

* Create 1 combined data coordinator
and UpnpEntity class

* Updates on coordinator

* Update comment

* Fix in async_step_init for coordinator

* Add async_get_status to mocked device
and set times polled for each call seperately

* Updated to get device through coordinator
Check polling for each status call seperately

* Use collections.abc instead of Typing for Mapping

* Remove adding device to hass.data as coordinator
is now saved

* Removed setting _coordinator

* Added myself as codeowner

* Update type in __init__

* Removed attributes from binary sensor

* Fix async_unload_entry

* Add expected return value to is_on

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-08-17 20:23:41 +02:00
Steven Looman 2c1728022d
Use ssdp callbacks in upnp (#53840) 2021-08-13 11:13:25 -05:00
Steven Looman 72bc748081
Avoid supplemental discovery of ignored upnp entry (#53250) 2021-07-20 15:46:33 -10:00
J. Nick Koston d56bd61b93
Populate upnp devices from ssdp (#51221)
* Populate upnp devices from ssdp

* Update tests since data comes in via HASS format now

* pylint
2021-06-08 22:32:06 +02:00
Ville Skyttä 631ab367e2
Fix typing.Any spelling (#49673) 2021-04-25 09:36:21 -10:00
jan iversen 6992e24263
Rename HomeAssistantType —> HomeAssistant, integrations t* - v* (#49544)
* Integration vizio: HomeAssistantType -> HomeAssistant.

* Integration velbus: HomeAssistantType -> HomeAssistant.

* Integration vacuum: HomeAssistantType -> HomeAssistant.

* Integration upnp: HomeAssistantType -> HomeAssistant.

* Integration upcloud: HomeAssistantType -> HomeAssistant.

* Integration twinkly: HomeAssistantType -> HomeAssistant.

* Integration tts: HomeAssistantType -> HomeAssistant.

* Integration tradfri: HomeAssistantType -> HomeAssistant.

* Integration traccar: HomeAssistantType -> HomeAssistant.

* Integration tplink: HomeAssistantType -> HomeAssistant.
2021-04-22 10:53:57 -04:00
Steven Looman 555f508b8c
Reinitialize upnp device on config change (#49081)
* Store coordinator at Device

* Use DeviceUpdater to follow config/location changes

* Cleaning up

* Fix unit tests + review changes

* Don't test internals
2021-04-14 23:39:44 +02:00
Steven Looman efa339ca54
Allow upnp ignore SSDP-discoveries (#46592) 2021-02-20 16:26:17 -10:00
Steven Looman 71c169c84f
Address late review comments for upnp (#45696) 2021-01-29 12:27:57 +01:00
Steven Looman 25c5c6aec9
Refactoring upnp component (#43646) 2021-01-29 10:23:34 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Steven Looman c812812631
Don't set upnp config_entry.unique_id from setup entry (#40988)
* Don't set config_entry.unique_id from setup entry. Fixes #40168

* Ensure entry has a unique_id

* Add test test_flow_import_incomplete

* Add test test_flow_import_duplicate

* Re-add testing import_info

* Simplify import flow

* Remove not needed line

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-06 13:57:36 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Steven Looman d0d9b4df78
Properly handle incomplete upnp ssdp discovery (#35553) 2020-05-14 22:58:41 +02:00
Steven Looman 48899c7a1c
Move upnp update_interval options flow (#35474) 2020-05-11 20:03:12 +02:00
Steven Looman a97460d1ab
Make upnp update interval configurable (#35298)
* Simplification of upnp component

* Make update interval configurable

* Description

* Require minimal value of 30

* Black

* Linting

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-09 21:52:08 -05:00
Steven Looman ee07fac9bc
Simplification of upnp component (#35191) 2020-05-04 10:30:43 -07:00
Steven Looman 6afb42bf7a
Improve UPnP configuration flow (#34737) 2020-05-02 18:03:54 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen 0d700f6a63
Fix tests for Python 3.8 (#34672) 2020-04-25 14:32:55 -07:00
Steven Looman dfc66b2018
Rewrite parts of upnp component (#33108)
* Rewrite parts of upnp component

* Linting

* Add SCAN_INTERVAL

* Get values simultaneously

* Move to time related constants, as per #32065

* Linting

* Move constant KIBIBYTE to homeassistant.const

* Simplify code

* Fix tests for #33344

* Changes after review

* Update homeassistant/components/upnp/sensor.py

* Changes after review

* Formatting

* Formatting

* Use ST from discovery info to avoid swapping device_types if device advertises multiple versions

* Linting

* Requirements for upnp + dlna_dmr components

* Linting

* Regen requirements

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

* Formatting

* Linting

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-11 00:24:03 +02:00
Ziv 0d05bd309a
Fix uncaught exceptions in upnp (#33604)
removed also the yr tests that are already successful
2020-04-03 22:44:57 -07:00
Ville Skyttä a12cf7211d Upgrade pydocstyle to 5.0.1 (#29830)
* Upgrade pydocstyle to 5.0.1

http://www.pydocstyle.org/en/5.0.1/release_notes.html

* Pydocstyle and other docstring fixes
2019-12-10 23:25:06 +01:00
Bas Nijholt e37443f10c Sort imports according to PEP8 for components starting with "U" (#29779)
* use isort to sort imports for components starting with 'u'

* add 'pylint: disable=import-error' to the right place
2019-12-09 19:07:32 +01:00
Paulus Schoutsen 54c24de158
Install requirements for all deps with tests (#27362)
* Install requirements for all deps with tests

* Remove unused REQUIREMENTS var

* Print diff if not the same

* Simplify

* Update command line

* Fix detecting empty dirs

* Install non-integration

* Fix upnp tests

* Lint

* Fix ZHA test
2019-10-09 16:16:29 -07:00
Paulus Schoutsen 6f357cb23e First pass fixing tests that raise exceptions caught by asyncio.gather (#25860)
* First pass fixing tests that raise exceptions caught by asyncio.gather

* Fix demo test

* lint
2019-08-12 16:42:12 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00