From f02adddba18e146025f7ab8cadf6582d257e2840 Mon Sep 17 00:00:00 2001 From: Wizmo2 Date: Thu, 30 Jun 2022 16:12:20 -0400 Subject: [PATCH] revert dev coverflow --- custom_components/zidoo/config_flow.py | 67 -------------------------- 1 file changed, 67 deletions(-) diff --git a/custom_components/zidoo/config_flow.py b/custom_components/zidoo/config_flow.py index e598c4c..adc86f1 100644 --- a/custom_components/zidoo/config_flow.py +++ b/custom_components/zidoo/config_flow.py @@ -112,73 +112,6 @@ async def async_step_import(self, user_input): """Handle import.""" return await self.async_step_user(user_input) - async def async_step_ssdp(self, discovery_info): - """Handle a discovered Zidoo device.""" - # _LOGGER.debug("SSDP discovery_info: %s", discovery_info) - parsed_url = urlparse(discovery_info.ssdp_location) - friendly_name = discovery_info.upnp[ssdp.ATTR_UPNP_FRIENDLY_NAME] - - self._async_abort_entries_match({CONF_HOST: parsed_url.hostname}) - - self.context["title_placeholders"] = {"name": friendly_name} - - self.discovery_config = { - CONF_HOST: parsed_url.hostname, - CONF_NAME: friendly_name, - CONF_PASSWORD: None, - } - _LOGGER.debug("SSDP config: %s", self.discovery_config) - - # verify we can connect - errors = {} - try: - validated = await validate_input(self.hass, self.discovery_config) - except InvalidAuth: - errors["base"] = "auth_failure" - except CannotConnect: - errors["base"] = "timeout_error" - except UnknownError: - _LOGGER.exception("Unexpected exception") - errors["base"] = "unknown" - - if "base" not in errors: - unique_id = str(f"{DOMAIN}-{validated['mac']}") - await self.async_set_unique_id(unique_id) - self._abort_if_unique_id_configured() - - # self.discovery_config[CONF_NAME] = validated["title"] - self.discovery_config[CONF_MAC] = validated["mac"] - return await self.async_step_link() - - async def async_step_link( self, user_input=None, confirm_only=False): - """Allow the user to confirm adding the device.""" - #_LOGGER.debug("Link user_info: %s", user_input) - if user_input is not None: - # Add name and host to config - user_input[CONF_NAME] = self.discovery_config[CONF_NAME] - user_input[CONF_HOST] = self.discovery_config[CONF_HOST] - user_input[CONF_MAC] = self.discovery_config[CONF_MAC] - _LOGGER.debug("Link Create config: %s", user_input) - return self.async_create_entry( - title=user_input[CONF_NAME], data=user_input - ) - - self._set_confirm_only() - - return self.async_show_form( - step_id="link", - description_placeholders={ - CONF_HOST: self.discovery_config[CONF_HOST], - CONF_NAME: self.discovery_config[CONF_NAME], - }, - data_schema=vol.Schema( - { - vol.Optional(CONF_PASSWORD): str - } - ), - ) - - class ZidooOptionsFlowHandler(config_entries.OptionsFlow): """Handle a option flow for wiser hub."""