Skip to content

Commit

Permalink
backout discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Wizmo2 committed Dec 11, 2021
1 parent 5e4469e commit 42867c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
37 changes: 1 addition & 36 deletions custom_components/zidoo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from homeassistant import config_entries, exceptions
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD
from homeassistant.core import callback
from homeassistant.components import ssdp
from urllib.parse import urlparse

from .const import (
_LOGGER,
Expand All @@ -18,9 +16,6 @@
CONF_SHORTCUT,
)

SUPPORTED_MANUFACTURERS = ["Zidoo", "ZIDOO", "Plutinosoft LLCL"]
IGNORED_MODELS = []

DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_HOST): str,
Expand Down Expand Up @@ -76,7 +71,7 @@ def async_get_options_flow(config_entry):
"""Return flow options."""
return ZidooOptionsFlowHandler(config_entry)

async def async_step_user(self, user_input=None, confirmOnly=False):
async def async_step_user(self, user_input=None):
"""
Manage device specific parameters.
"""
Expand All @@ -102,15 +97,6 @@ async def async_step_user(self, user_input=None, confirmOnly=False):
title=validated["title"], data=user_input
)

if confirmOnly:
name = self.context.get(CONF_NAME)
return self.async_show_form(
step_id="user",
description_placeholders={"name": name},
data_schema=vol.Schema({vol.Optional(CONF_PASSWORD): str}),
errors=errors,
)

return self.async_show_form(
step_id="user",
data_schema=self.discovery_schema or DATA_SCHEMA,
Expand All @@ -120,27 +106,6 @@ async def async_step_user(self, user_input=None, confirmOnly=False):
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 Harmony device."""
_LOGGER.debug("SSDP discovery_info: %s", discovery_info)

parsed_url = urlparse(discovery_info[ssdp.ATTR_SSDP_LOCATION])
friendly_name = discovery_info[ssdp.ATTR_UPNP_FRIENDLY_NAME]

self._async_abort_entries_match({CONF_HOST: parsed_url.hostname})

self.context["title_placeholders"] = {"name": friendly_name}

user_input = {
CONF_HOST: parsed_url.hostname,
CONF_NAME: friendly_name,
}

_LOGGER.debug("SSDP discovery_info: %s", user_input)

return self.async_step_user(user_input, True)

class ZidooOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for wiser hub."""

Expand Down
16 changes: 1 addition & 15 deletions custom_components/zidoo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,5 @@
"requirements": [],
"codeowners": ["@wizmo2"],
"iot_class": "local_polling",
"version": "1.2.6",
"ssdp": [
{
"manufacturer": "Zidoo",
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1"
},
{
"manufacturer": "ZIDOO",
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1"
},
{
"manufacturer": "Plutinosoft LLC",
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1"
}
]
"version": "1.2.6"
}

0 comments on commit 42867c0

Please sign in to comment.