Skip to content

Commit 488c975

Browse files
authored
Move translatable URLs out of strings.json for opentherm_gw integration (home-assistant#157437)
1 parent 3b52c5d commit 488c975

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

homeassistant/components/opentherm_gw/services.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ async def set_gpio_mode(call: ServiceCall) -> None:
237237
await gw_hub.gateway.set_gpio_mode(gpio_id, gpio_mode)
238238

239239
hass.services.async_register(
240-
DOMAIN, SERVICE_SET_GPIO_MODE, set_gpio_mode, service_set_gpio_mode_schema
240+
DOMAIN,
241+
SERVICE_SET_GPIO_MODE,
242+
set_gpio_mode,
243+
service_set_gpio_mode_schema,
244+
description_placeholders={
245+
"gpio_modes_documentation_url": "https://www.home-assistant.io/integrations/opentherm_gw/#gpio-modes"
246+
},
241247
)
242248

243249
async def set_led_mode(call: ServiceCall) -> None:
@@ -248,7 +254,13 @@ async def set_led_mode(call: ServiceCall) -> None:
248254
await gw_hub.gateway.set_led_mode(led_id, led_mode)
249255

250256
hass.services.async_register(
251-
DOMAIN, SERVICE_SET_LED_MODE, set_led_mode, service_set_led_mode_schema
257+
DOMAIN,
258+
SERVICE_SET_LED_MODE,
259+
set_led_mode,
260+
service_set_led_mode_schema,
261+
description_placeholders={
262+
"led_modes_documentation_url": "https://www.home-assistant.io/integrations/opentherm_gw/#led-modes"
263+
},
252264
)
253265

254266
async def set_max_mod(call: ServiceCall) -> None:
@@ -294,4 +306,7 @@ async def send_transparent_cmd(call: ServiceCall) -> None:
294306
SERVICE_SEND_TRANSP_CMD,
295307
send_transparent_cmd,
296308
service_send_transp_cmd_schema,
309+
description_placeholders={
310+
"opentherm_gateway_firmware_url": "https://otgw.tclcode.com/firmware.html"
311+
},
297312
)

homeassistant/components/opentherm_gw/strings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
"name": "Reset gateway"
387387
},
388388
"send_transparent_command": {
389-
"description": "Sends custom otgw commands (https://otgw.tclcode.com/firmware.html) through a transparent interface.",
389+
"description": "Sends custom OTGW commands ({opentherm_gateway_firmware_url}) through a transparent interface.",
390390
"fields": {
391391
"gateway_id": {
392392
"description": "[%key:component::opentherm_gw::services::reset_gateway::fields::gateway_id::description%]",
@@ -461,7 +461,7 @@
461461
"name": "ID"
462462
},
463463
"mode": {
464-
"description": "Mode to set on the GPIO pin. Values 0 through 6 are accepted for both GPIOs, 7 is only accepted for GPIO \"B\". See https://www.home-assistant.io/integrations/opentherm_gw/#gpio-modes for an explanation of the values.",
464+
"description": "Mode to set on the GPIO pin. Values 0 through 6 are accepted for both GPIOs, 7 is only accepted for GPIO \"B\". See {gpio_modes_documentation_url} for an explanation of the values.",
465465
"name": "[%key:common::config_flow::data::mode%]"
466466
}
467467
},
@@ -507,7 +507,7 @@
507507
"name": "ID"
508508
},
509509
"mode": {
510-
"description": "The function to assign to the LED. See https://www.home-assistant.io/integrations/opentherm_gw/#led-modes for an explanation of the values.",
510+
"description": "The function to assign to the LED. See {led_modes_documentation_url} for an explanation of the values.",
511511
"name": "[%key:common::config_flow::data::mode%]"
512512
}
513513
},

0 commit comments

Comments
 (0)