Skip to content

Commit 9c1d874

Browse files
MichaelMKKellyfrenck
authored andcommitted
Move URL out of system_bridge strings.json (home-assistant#155067)
1 parent 4a00311 commit 9c1d874

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

homeassistant/components/system_bridge/config_flow.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from homeassistant.helpers.aiohttp_client import async_get_clientsession
2525
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
2626

27-
from .const import DATA_WAIT_TIMEOUT, DOMAIN
27+
from .const import DATA_WAIT_TIMEOUT, DOMAIN, SYNTAX_KEYS_DOCUMENTATION_URL
2828

2929
_LOGGER = logging.getLogger(__name__)
3030

@@ -132,7 +132,11 @@ async def async_step_user(
132132
"""Handle the initial step."""
133133
if user_input is None:
134134
return self.async_show_form(
135-
step_id="user", data_schema=STEP_USER_DATA_SCHEMA
135+
step_id="user",
136+
data_schema=STEP_USER_DATA_SCHEMA,
137+
description_placeholders={
138+
"syntax_keys_documentation_url": SYNTAX_KEYS_DOCUMENTATION_URL
139+
},
136140
)
137141

138142
errors, info = await _async_get_info(self.hass, user_input)
@@ -144,7 +148,12 @@ async def async_step_user(
144148
return self.async_create_entry(title=info["hostname"], data=user_input)
145149

146150
return self.async_show_form(
147-
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
151+
step_id="user",
152+
data_schema=STEP_USER_DATA_SCHEMA,
153+
errors=errors,
154+
description_placeholders={
155+
"syntax_keys_documentation_url": SYNTAX_KEYS_DOCUMENTATION_URL
156+
},
148157
)
149158

150159
async def async_step_authenticate(
@@ -174,7 +183,10 @@ async def async_step_authenticate(
174183
return self.async_show_form(
175184
step_id="authenticate",
176185
data_schema=STEP_AUTHENTICATE_DATA_SCHEMA,
177-
description_placeholders={"name": self._name},
186+
description_placeholders={
187+
"name": self._name,
188+
"syntax_keys_documentation_url": SYNTAX_KEYS_DOCUMENTATION_URL,
189+
},
178190
errors=errors,
179191
)
180192

homeassistant/components/system_bridge/const.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from systembridgemodels.modules import Module
66

7+
SYNTAX_KEYS_DOCUMENTATION_URL = "http://robotjs.io/docs/syntax#keys"
8+
79
DOMAIN = "system_bridge"
810

911
MODULES: Final[list[Module]] = [

homeassistant/components/system_bridge/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
},
195195
"key": {
196196
"name": "Key",
197-
"description": "Key to press. List available here: http://robotjs.io/docs/syntax#keys."
197+
"description": "Key to press. List available here: {syntax_keys_documentation_url}."
198198
}
199199
}
200200
},

0 commit comments

Comments
 (0)