Commit Graph

28 Commits (3d308e0599a4c968bf19853ff6e33302f6cc623a)

Author SHA1 Message Date
J. Nick Koston fdc5208d18
Prevent the zeroconf service browser from terminating when a device without any addresses is discovered. (#38094) 2020-07-22 20:21:57 -10:00
J. Nick Koston 5cf7b1b1bc
Ensure we do not start discovered flows until after the started event has fired (#38047)
* Ensure we do not start discovered flows until after the start event has fired

This change makes zeroconf and ssdp match discovery behavior of not
creating config flows until the start event has been fired.  This
prevents config flow creation/dependency installs for discovered
config flows from competing for cpu time during startup.

* Start discovery/service browser/ssdp when EVENT_HOMEASSISTANT_STARTED is fired instead of EVENT_HOMEASSISTANT_START
2020-07-21 14:18:43 -10:00
J. Nick Koston abe3e3094e
Provide workaround for missing/disabled/broken IPv6 (#37887) 2020-07-15 11:26:40 -07:00
J. Nick Koston bfbb2826bc
Fix homekit_controller discovery via zeroconf (#37725) 2020-07-13 17:45:05 -07:00
J. Nick Koston 5e65d8d3c3
Upgrade zeroconf to 0.27.1 (#36277) 2020-06-05 14:33:26 -07:00
J. Nick Koston b0578018cb
Use a single service browser for zeroconf discovery (#35997) 2020-05-23 18:05:41 +02:00
J. Nick Koston a42a654590
Fix reversed logic in zeroconf homekit pairing check (#35596)
* Fix reversed logic in zeroconf homekit pairing check

* s/server_info/service_info/
2020-05-14 18:58:40 +02:00
J. Nick Koston 16cc4aed06
Ensure homekit_controller recieves zeroconf c# updates (#35545)
* Ensure homekit_controller recieves zeroconf c# updates

If an integration has a homekit config flow step
homekit controller would not see updates for
devices that were paired with it and would not
rescan for changes.

* Only send updates to homekit controller if the device is paired

This avoids the device showing up a second time.

* remove debug

* fix refactor error
2020-05-12 14:59:29 -05:00
J. Nick Koston 3315c4c6c3
Pre-filter zeroconf service browser updates (#35518)
Each ServerBrowser currently runs in its own thread which
processes every A or AAAA record update per instance.

As the list of zeroconf names we watch for grows, each additional
ServiceBrowser would process all the A and AAAA updates on the network.

To avoid overwhemling the system we pre-filter here and only process
DNSPointers for the configured record name (type)
2020-05-11 18:30:15 -05:00
Paulus Schoutsen 9d83059f14
Allow zeroconf instance sharing (#35484) 2020-05-10 22:51:23 -07:00
J. Nick Koston 70b29dc823
Make interface_choice option effective (#35444)
I missed the second commit that actually makes this
work in the original merge.
2020-05-10 14:30:54 -05:00
J. Nick Koston 3219c380c7
Provide zeroconf option to bind to only the default interface (#35281)
By default zeroconf binds to every interface.
2020-05-06 09:16:59 -05:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen 9a4a83cb91
Fix py38 tests (#34658) 2020-04-24 15:09:45 -07:00
jjlawren 82784a320c
Ignore non-ASCII keys in zeroconf payloads (#34344)
* Ignore non-ASCII keys in zeroconf payloads

* Don't rely on logging for test
2020-04-17 19:36:46 -05:00
Paulus Schoutsen 0b90ebf91e
Allow async_setup changes to config entry data be taken into a… (#34166)
* Allow async_setup changes to config entry data be taken into account

* Fix tests

* Limit scope try…finally

* Update tests/test_config_entries.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Fix import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-14 18:46:41 -07:00
J. Nick Koston f93e4e3de7
Support homekit matches that have a dash after the model (#33274) 2020-03-26 15:15:35 -07:00
J. Nick Koston f9a7c64106
Config flow for doorbird (#33165)
* Config flow for doorbird

* Discoverable via zeroconf

* Fix zeroconf test

* add missing return

* Add a test for legacy over ride url (will go away when refactored to cloud hooks)

* Update homeassistant/components/doorbird/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* without getting the hooks its not so useful

* Update homeassistant/components/doorbird/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix copy pasta

* remove identifiers since its in connections

* self review fixes

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-23 10:14:21 +01:00
Raman Gupta ee74f95371 Enhance info_from_service function in zeroconf integration (#31059)
* enhance zeroconf service info decoding to include raw bytes

* Update homeassistant/components/zeroconf/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix test based on last commit

* fix test based on last commit

* remove .keys() when asserting processed and raw service info properties

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-21 21:24:59 -08:00
Ville Skyttä fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Bas Nijholt 6cc75fc6f3 Sort imports according to PEP8 for components starting with "Z" (#29784)
* use isort to sort imports for components starting with 'z'

* add skip to end of zha/core/channels/__init__.py

* put 'pylint: disable=import-error' at the right place

* remove the import of config_flow in zha/__init__.py

According to @balloob it is no longer needed.

* revert previous commit

* isort:skip homeassistant/components/zha/__init__.py completely
2019-12-09 18:54:54 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen 0dc0706eb2
Add more HomeKit models for discovery (#24391)
* Add more HomeKit models for discovery

* Discover Tradfri with HomeKit

* Add Wemo device info

* Allow full match for HomeKit model

* Fix tests
2019-06-07 22:59:51 -07:00
Paulus Schoutsen 3c1cdecb88
Add manifest support for homekit discovery (#24225)
* Add manifest support for homekit discovery

* Add a space after model check

* Update comment
2019-05-31 11:58:48 -07:00
Robert Svensson 84baaa324c Revert Zeroconf back to previously used library (#24139)
* Revert back to previously used library

* Fix test

* Remove unused import

* Fix import

* Update __init__.py

* Update __init__.py

* Fix test after rebase
2019-05-29 14:20:06 -07:00
Robert Svensson 3fef9a93cf Trådfri component to use new zeroconf discovery (#24041)
* Move tradfri component to use new zeroconf discovery

* Will this work?

* Remove prints

* Correct order in generated zeroconf

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update test_init.py
2019-05-29 11:19:50 -07:00
Robert Svensson 085303c349 ESPHome component to use zeroconf discovery (#24043)
* Move ESPHome component to use zeroconf discovery

* Remove esphome from discovery component
2019-05-23 08:55:08 +02:00
Robert Svensson 636077c74d Zeroconf discovery for config entries (#23919)
* Proof of concept

* Follow comments

* Fix line length and bad imports

* Move imports to top

* Exception handling for unicode decoding
Create debug print for new service types
Add empty test files

* First try at a test

* Add type and name to service info
Fix static check

* Add aiozeroconf to test dependencies
2019-05-21 15:36:26 -07:00