From d8a448d131ed3bf2c7581b32ec3fb07de4e27b99 Mon Sep 17 00:00:00 2001 From: Martin <32802427+mstu01@users.noreply.github.com> Date: Mon, 27 Jul 2026 15:23:22 +0200 Subject: [PATCH] Remove name field from Sony PlayStation 4 config flow (#177046) --- homeassistant/components/ps4/config_flow.py | 7 +------ homeassistant/components/ps4/strings.json | 1 - tests/components/ps4/test_config_flow.py | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/homeassistant/components/ps4/config_flow.py b/homeassistant/components/ps4/config_flow.py index 6525cb30ab15..9e30e5355bf3 100644 --- a/homeassistant/components/ps4/config_flow.py +++ b/homeassistant/components/ps4/config_flow.py @@ -50,7 +50,6 @@ class PlayStation4FlowHandler(ConfigFlow, domain=DOMAIN): """Initialize the config flow.""" self.helper = Helper() self.creds: str | None = None - self.name = None self.host = None self.region = None self.pin: str | None = None @@ -166,7 +165,6 @@ class PlayStation4FlowHandler(ConfigFlow, domain=DOMAIN): # Login to PS4 with user data. if user_input is not None: self.region = user_input[CONF_REGION] - self.name = user_input[CONF_NAME] # Assume pin had leading zeros, before coercing to int. self.pin = str(user_input[CONF_CODE]).zfill(PIN_LENGTH) self.host = user_input[CONF_IP_ADDRESS] @@ -187,7 +185,7 @@ class PlayStation4FlowHandler(ConfigFlow, domain=DOMAIN): else: device = { CONF_HOST: self.host, - CONF_NAME: self.name, + CONF_NAME: DEFAULT_NAME, CONF_REGION: self.region, } @@ -216,9 +214,6 @@ class PlayStation4FlowHandler(ConfigFlow, domain=DOMAIN): link_schema[vol.Required(CONF_CODE)] = vol.All( vol.Strip, vol.Length(max=PIN_LENGTH), vol.Coerce(int) ) - # Name field is no longer allowed in config flow schemas - # pylint: disable-next=home-assistant-config-flow-name-field - link_schema[vol.Required(CONF_NAME, default=DEFAULT_NAME)] = str return self.async_show_form( step_id="link", data_schema=vol.Schema(link_schema), errors=errors diff --git a/homeassistant/components/ps4/strings.json b/homeassistant/components/ps4/strings.json index f2ab057b624e..f34a48f0e407 100644 --- a/homeassistant/components/ps4/strings.json +++ b/homeassistant/components/ps4/strings.json @@ -27,7 +27,6 @@ "data": { "code": "[%key:common::config_flow::data::pin%]", "ip_address": "[%key:common::config_flow::data::ip%]", - "name": "[%key:common::config_flow::data::name%]", "region": "Region" }, "data_description": { diff --git a/tests/components/ps4/test_config_flow.py b/tests/components/ps4/test_config_flow.py index a4e6b039a920..776aab7c8649 100644 --- a/tests/components/ps4/test_config_flow.py +++ b/tests/components/ps4/test_config_flow.py @@ -47,13 +47,11 @@ MOCK_DEVICE_ADDITIONAL = { } MOCK_CONFIG = { CONF_IP_ADDRESS: MOCK_HOST, - CONF_NAME: DEFAULT_NAME, CONF_REGION: DEFAULT_REGION, CONF_CODE: MOCK_CODE, } MOCK_CONFIG_ADDITIONAL = { CONF_IP_ADDRESS: MOCK_HOST_ADDITIONAL, - CONF_NAME: DEFAULT_NAME, CONF_REGION: DEFAULT_REGION, CONF_CODE: MOCK_CODE, }