From 754e291e1e6d0729a227cb7ce2015810d7cc5f2f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 13 Jan 2022 13:17:16 +0100 Subject: [PATCH] Remove unused serial number config entry data from Elgato (#64035) --- homeassistant/components/elgato/config_flow.py | 3 +-- homeassistant/components/elgato/const.py | 2 -- tests/components/elgato/__init__.py | 3 +-- tests/components/elgato/test_config_flow.py | 6 ++---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/elgato/config_flow.py b/homeassistant/components/elgato/config_flow.py index 12d1b5d1d93..27883bbcfb5 100644 --- a/homeassistant/components/elgato/config_flow.py +++ b/homeassistant/components/elgato/config_flow.py @@ -13,7 +13,7 @@ from homeassistant.core import callback from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers.aiohttp_client import async_get_clientsession -from .const import CONF_SERIAL_NUMBER, DOMAIN +from .const import DOMAIN class ElgatoFlowHandler(ConfigFlow, domain=DOMAIN): @@ -89,7 +89,6 @@ class ElgatoFlowHandler(ConfigFlow, domain=DOMAIN): data={ CONF_HOST: self.host, CONF_PORT: self.port, - CONF_SERIAL_NUMBER: self.serial_number, }, ) diff --git a/homeassistant/components/elgato/const.py b/homeassistant/components/elgato/const.py index 6e63b598346..17a9090841a 100644 --- a/homeassistant/components/elgato/const.py +++ b/homeassistant/components/elgato/const.py @@ -6,7 +6,5 @@ DOMAIN = "elgato" # Attributes ATTR_ON = "on" -CONF_SERIAL_NUMBER = "serial_number" - # Services SERVICE_IDENTIFY = "identify" diff --git a/tests/components/elgato/__init__.py b/tests/components/elgato/__init__.py index 12df481d182..9e6c9155f8a 100644 --- a/tests/components/elgato/__init__.py +++ b/tests/components/elgato/__init__.py @@ -1,6 +1,6 @@ """Tests for the Elgato Key Light integration.""" -from homeassistant.components.elgato.const import CONF_SERIAL_NUMBER, DOMAIN +from homeassistant.components.elgato.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_PORT, CONTENT_TYPE_JSON from homeassistant.core import HomeAssistant @@ -60,7 +60,6 @@ async def init_integration( data={ CONF_HOST: "127.0.0.1", CONF_PORT: 9123, - CONF_SERIAL_NUMBER: "CN11A1A00001", }, ) diff --git a/tests/components/elgato/test_config_flow.py b/tests/components/elgato/test_config_flow.py index 2ea2dab6acf..bd9a631b815 100644 --- a/tests/components/elgato/test_config_flow.py +++ b/tests/components/elgato/test_config_flow.py @@ -3,7 +3,7 @@ import aiohttp from homeassistant import data_entry_flow from homeassistant.components import zeroconf -from homeassistant.components.elgato.const import CONF_SERIAL_NUMBER, DOMAIN +from homeassistant.components.elgato.const import DOMAIN from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF from homeassistant.const import CONF_HOST, CONF_PORT, CONF_SOURCE, CONTENT_TYPE_JSON from homeassistant.core import HomeAssistant @@ -52,7 +52,6 @@ async def test_full_user_flow_implementation( assert result["data"][CONF_HOST] == "127.0.0.1" assert result["data"][CONF_PORT] == 9123 - assert result["data"][CONF_SERIAL_NUMBER] == "CN11A1A00001" assert result["title"] == "CN11A1A00001" assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY @@ -83,7 +82,7 @@ async def test_full_zeroconf_flow_implementation( ), ) - assert result["description_placeholders"] == {CONF_SERIAL_NUMBER: "CN11A1A00001"} + assert result["description_placeholders"] == {"serial_number": "CN11A1A00001"} assert result["step_id"] == "zeroconf_confirm" assert result["type"] == data_entry_flow.RESULT_TYPE_FORM @@ -97,7 +96,6 @@ async def test_full_zeroconf_flow_implementation( ) assert result["data"][CONF_HOST] == "127.0.0.1" assert result["data"][CONF_PORT] == 9123 - assert result["data"][CONF_SERIAL_NUMBER] == "CN11A1A00001" assert result["title"] == "CN11A1A00001" assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY