Remove zeroconf discovery from Spotify (#146213)

This commit is contained in:
Joost Lekkerkerker 2025-06-05 18:02:11 +02:00 committed by GitHub
parent b14cd1e14b
commit 14664719d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2 additions and 50 deletions

View File

@ -8,6 +8,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["spotifyaio"],
"requirements": ["spotifyaio==0.8.11"],
"zeroconf": ["_spotify-connect._tcp.local."]
"requirements": ["spotifyaio==0.8.11"]
}

View File

@ -7,9 +7,6 @@
"reauth_confirm": {
"title": "[%key:common::config_flow::title::reauth%]",
"description": "The Spotify integration needs to re-authenticate with Spotify for account: {account}"
},
"oauth_discovery": {
"description": "Home Assistant has found Spotify on your network. Press **Submit** to continue setting up Spotify."
}
},
"abort": {

View File

@ -865,11 +865,6 @@ ZEROCONF = {
"domain": "soundtouch",
},
],
"_spotify-connect._tcp.local.": [
{
"domain": "spotify",
},
],
"_ssh._tcp.local.": [
{
"domain": "smappee",

View File

@ -1,33 +1,21 @@
"""Tests for the Spotify config flow."""
from http import HTTPStatus
from ipaddress import ip_address
from unittest.mock import MagicMock, patch
import pytest
from spotifyaio import SpotifyConnectionError
from homeassistant.components.spotify.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.config_entries import SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
from homeassistant.helpers import config_entry_oauth2_flow
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
from tests.common import MockConfigEntry
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import ClientSessionGenerator
BLANK_ZEROCONF_INFO = ZeroconfServiceInfo(
ip_address=ip_address("1.2.3.4"),
ip_addresses=[ip_address("1.2.3.4")],
hostname="mock_hostname",
name="mock_name",
port=None,
properties={},
type="mock_type",
)
async def test_abort_if_no_configuration(hass: HomeAssistant) -> None:
"""Check flow aborts when no configuration is present."""
@ -39,18 +27,6 @@ async def test_abort_if_no_configuration(hass: HomeAssistant) -> None:
assert result["reason"] == "missing_credentials"
async def test_zeroconf_abort_if_existing_entry(hass: HomeAssistant) -> None:
"""Check zeroconf flow aborts when an entry already exist."""
MockConfigEntry(domain=DOMAIN).add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_ZEROCONF}, data=BLANK_ZEROCONF_INFO
)
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "already_configured"
@pytest.mark.usefixtures("current_request_with_host")
@pytest.mark.usefixtures("setup_credentials")
async def test_full_flow(
@ -258,18 +234,3 @@ async def test_reauth_account_mismatch(
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "reauth_account_mismatch"
async def test_zeroconf(hass: HomeAssistant) -> None:
"""Check zeroconf flow aborts when an entry already exist."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_ZEROCONF}, data=BLANK_ZEROCONF_INFO
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "oauth_discovery"
result = await hass.config_entries.flow.async_configure(result["flow_id"], {})
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "missing_credentials"