Add support for USB dongles to the hardware integration (#76795)

* Add support for USB dongles to the hardware integration

* Update hardware integrations

* Adjust tests

* Add USB discovery for SkyConnect 1.0

* Improve test coverage

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix frozen dataclass shizzle

* Adjust test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Erik Montnemery 2022-08-18 21:52:12 +02:00 committed by GitHub
parent fb5a67fb1f
commit bb74730e96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 581 additions and 28 deletions

View file

@ -138,11 +138,11 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
)
self._set_confirm_only()
self.context["title_placeholders"] = {CONF_NAME: self._title}
return await self.async_step_confirm()
return await self.async_step_confirm_usb()
async def async_step_confirm(self, user_input=None):
"""Confirm a discovery."""
if user_input is not None:
async def async_step_confirm_usb(self, user_input=None):
"""Confirm a USB discovery."""
if user_input is not None or not onboarding.async_is_onboarded(self.hass):
auto_detected_data = await detect_radios(self._device_path)
if auto_detected_data is None:
# This path probably will not happen now that we have
@ -155,7 +155,7 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
)
return self.async_show_form(
step_id="confirm",
step_id="confirm_usb",
description_placeholders={CONF_NAME: self._title},
)