diff --git a/homeassistant/components/discovery/__init__.py b/homeassistant/components/discovery/__init__.py index 027ba110b5f..2765757d737 100644 --- a/homeassistant/components/discovery/__init__.py +++ b/homeassistant/components/discovery/__init__.py @@ -47,7 +47,6 @@ SERVICE_XIAOMI_GW = 'xiaomi_gw' CONFIG_ENTRY_HANDLERS = { SERVICE_DAIKIN: 'daikin', - SERVICE_HEOS: 'heos', SERVICE_TELLDUSLIVE: 'tellduslive', 'sonos': 'sonos', SERVICE_IGD: 'upnp', @@ -97,6 +96,7 @@ MIGRATED_SERVICE_HANDLERS = [ 'deconz', 'esphome', 'google_cast', + SERVICE_HEOS, 'homekit', 'ikea_tradfri', 'philips_hue', diff --git a/homeassistant/components/heos/config_flow.py b/homeassistant/components/heos/config_flow.py index 064813a86a7..8207d40be11 100644 --- a/homeassistant/components/heos/config_flow.py +++ b/homeassistant/components/heos/config_flow.py @@ -22,7 +22,7 @@ class HeosFlowHandler(config_entries.ConfigFlow): VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH - async def async_step_discovery(self, discovery_info): + async def async_step_ssdp(self, discovery_info): """Handle a discovered Heos device.""" # Store discovered host friendly_name = "{} ({})".format( diff --git a/homeassistant/components/heos/manifest.json b/homeassistant/components/heos/manifest.json index a1fc8030318..09833bb729b 100644 --- a/homeassistant/components/heos/manifest.json +++ b/homeassistant/components/heos/manifest.json @@ -6,6 +6,11 @@ "requirements": [ "pyheos==0.5.2" ], + "ssdp": { + "st": [ + "urn:schemas-denon-com:device:ACT-Denon:1" + ] + }, "dependencies": [], "codeowners": [ "@andrewsayre" diff --git a/homeassistant/generated/ssdp.py b/homeassistant/generated/ssdp.py index 63dbe7616db..62273bf303b 100644 --- a/homeassistant/generated/ssdp.py +++ b/homeassistant/generated/ssdp.py @@ -15,5 +15,9 @@ SSDP = { "hue" ] }, - "st": {} + "st": { + "urn:schemas-denon-com:device:ACT-Denon:1": [ + "heos" + ] + } } diff --git a/tests/components/heos/test_config_flow.py b/tests/components/heos/test_config_flow.py index ade0100dbd6..c1c5e308eae 100644 --- a/tests/components/heos/test_config_flow.py +++ b/tests/components/heos/test_config_flow.py @@ -76,7 +76,7 @@ async def test_create_entry_when_friendly_name_valid(hass, controller): async def test_discovery_shows_create_form(hass, controller, discovery_data): """Test discovery shows form to confirm setup and subsequent abort.""" await hass.config_entries.flow.async_init( - DOMAIN, context={'source': 'discovery'}, + DOMAIN, context={'source': 'ssdp'}, data=discovery_data) await hass.async_block_till_done() assert len(hass.config_entries.flow.async_progress()) == 1 @@ -87,7 +87,7 @@ async def test_discovery_shows_create_form(hass, controller, discovery_data): discovery_data[CONF_HOST] = "127.0.0.2" discovery_data[CONF_NAME] = "Bedroom" await hass.config_entries.flow.async_init( - DOMAIN, context={'source': 'discovery'}, + DOMAIN, context={'source': 'ssdp'}, data=discovery_data) await hass.async_block_till_done() assert len(hass.config_entries.flow.async_progress()) == 1 @@ -103,6 +103,6 @@ async def test_disovery_flow_aborts_already_setup( config_entry.add_to_hass(hass) flow = HeosFlowHandler() flow.hass = hass - result = await flow.async_step_discovery(discovery_data) + result = await flow.async_step_ssdp(discovery_data) assert result['type'] == data_entry_flow.RESULT_TYPE_ABORT assert result['reason'] == 'already_setup' diff --git a/tests/components/heos/test_init.py b/tests/components/heos/test_init.py index b709c89121a..6d8d9b7e78e 100644 --- a/tests/components/heos/test_init.py +++ b/tests/components/heos/test_init.py @@ -27,7 +27,8 @@ async def test_async_setup_creates_entry(hass, config): assert entry.data == {CONF_HOST: '127.0.0.1'} -async def test_async_setup_updates_entry(hass, config_entry, config): +async def test_async_setup_updates_entry(hass, config_entry, config, + controller): """Test component setup updates entry from config.""" config[DOMAIN][CONF_HOST] = '127.0.0.2' config_entry.add_to_hass(hass)