mirror of
https://github.com/home-assistant/core.git
synced 2026-08-07 13:55:32 +01:00
Remove name field from Sony PlayStation 4 config flow (#177046)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user