Clean up vizio translation strings (#35725)

* further vizio string updates

* fix errant find/replace
This commit is contained in:
Raman Gupta 2020-05-25 16:36:49 -04:00 committed by GitHub
parent 05cbb3f0e4
commit db92ffdf89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View file

@ -229,7 +229,7 @@ class VizioConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
user_input[CONF_DEVICE_CLASS],
session=async_get_clientsession(self.hass, False),
):
errors["base"] = "cant_connect"
errors["base"] = "cannot_connect"
if not errors:
unique_id = await VizioAsync.get_unique_id(
@ -323,7 +323,7 @@ class VizioConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
)
return self.async_abort(reason="updated_entry")
return self.async_abort(reason="already_setup")
return self.async_abort(reason="already_configured_device")
self._must_show_form = True
# Store config key/value pairs that are not configurable in user step so they
@ -354,7 +354,7 @@ class VizioConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
continue
if _host_is_same(entry.data[CONF_HOST], discovery_info[CONF_HOST]):
return self.async_abort(reason="already_setup")
return self.async_abort(reason="already_configured_device")
# Set default name to discovered device name by stripping zeroconf service
# (`type`) from `name`
@ -400,7 +400,7 @@ class VizioConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return self.async_show_form(
step_id="user",
data_schema=_get_config_schema(self._data),
errors={"base": "cant_connect"},
errors={"base": "cannot_connect"},
)
# Complete pairing process if PIN has been provided

View file

@ -2,7 +2,7 @@
"config": {
"step": {
"user": {
"title": "Setup VIZIO SmartCast Device",
"title": "VIZIO SmartCast Device",
"description": "An [%key:common::config_flow::data::access_token%] is only needed for TVs. If you are configuring a TV and do not have an [%key:common::config_flow::data::access_token%] yet, leave it blank to go through a pairing process.",
"data": {
"name": "Name",
@ -20,28 +20,28 @@
},
"pairing_complete": {
"title": "Pairing Complete",
"description": "Your VIZIO SmartCast device is now connected to Home Assistant."
"description": "Your [%key:component::vizio::config::step::user::title%] is now connected to Home Assistant."
},
"pairing_complete_import": {
"title": "Pairing Complete",
"description": "Your VIZIO SmartCast TV is now connected to Home Assistant.\n\nYour [%key:common::config_flow::data::access_token%] is '**{access_token}**'."
"description": "Your [%key:component::vizio::config::step::user::title%] is now connected to Home Assistant.\n\nYour [%key:common::config_flow::data::access_token%] is '**{access_token}**'."
}
},
"error": {
"host_exists": "VIZIO device with specified host already configured.",
"name_exists": "VIZIO device with specified name already configured.",
"host_exists": "[%key:component::vizio::config::step::user::title%] with specified host already configured.",
"name_exists": "[%key:component::vizio::config::step::user::title%] with specified name already configured.",
"complete_pairing_failed": "Unable to complete pairing. Ensure the PIN you provided is correct and the TV is still powered and connected to the network before resubmitting.",
"cant_connect": "[%key:common::config_flow::error::cannot_connect%]"
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"abort": {
"already_setup": "This entry has already been setup.",
"already_configured_device": "[%key:common::config_flow::abort::already_configured_device%]",
"updated_entry": "This entry has already been setup but the name, apps, and/or options defined in the configuration do not match the previously imported configuration, so the configuration entry has been updated accordingly."
}
},
"options": {
"step": {
"init": {
"title": "Update VIZIO SmartCast Options",
"title": "Update [%key:component::vizio::config::step::user::title%] Options",
"description": "If you have a Smart TV, you can optionally filter your source list by choosing which apps to include or exclude in your source list.",
"data": {
"volume_step": "Volume Step Size",

View file

@ -316,7 +316,7 @@ async def test_user_error_on_could_not_connect(
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {"base": "cant_connect"}
assert result["errors"] == {"base": "cannot_connect"}
async def test_user_tv_pairing_no_apps(
@ -363,7 +363,7 @@ async def test_user_start_pairing_failure(
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["step_id"] == "user"
assert result["errors"] == {"base": "cant_connect"}
assert result["errors"] == {"base": "cannot_connect"}
async def test_user_invalid_pin(
@ -471,7 +471,7 @@ async def test_import_entity_already_configured(
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "already_setup"
assert result["reason"] == "already_configured_device"
async def test_import_flow_update_options(
@ -778,7 +778,7 @@ async def test_zeroconf_flow_already_configured(
# Flow should abort because device is already setup
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "already_setup"
assert result["reason"] == "already_configured_device"
async def test_zeroconf_dupe_fail(