Skip to content

Commit 9734058

Browse files
authored
Move translatable URL out of strings.json for knx integration (home-assistant#155244)
1 parent b883d2f commit 9734058

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

homeassistant/components/knx/services.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939

4040
_LOGGER = logging.getLogger(__name__)
4141

42+
_DESCRIPTION_PLACEHOLDERS = {
43+
"sensor_value_types_url": "https://www.home-assistant.io/integrations/knx/#value-types"
44+
}
45+
4246

4347
@callback
4448
def async_setup_services(hass: HomeAssistant) -> None:
@@ -48,6 +52,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
4852
SERVICE_KNX_SEND,
4953
service_send_to_knx_bus,
5054
schema=SERVICE_KNX_SEND_SCHEMA,
55+
description_placeholders=_DESCRIPTION_PLACEHOLDERS,
5156
)
5257

5358
hass.services.async_register(
@@ -63,6 +68,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
6368
SERVICE_KNX_EVENT_REGISTER,
6469
service_event_register_modify,
6570
schema=SERVICE_KNX_EVENT_REGISTER_SCHEMA,
71+
description_placeholders=_DESCRIPTION_PLACEHOLDERS,
6672
)
6773

6874
async_register_admin_service(
@@ -71,6 +77,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
7177
SERVICE_KNX_EXPOSURE_REGISTER,
7278
service_exposure_register_modify,
7379
schema=SERVICE_KNX_EXPOSURE_REGISTER_SCHEMA,
80+
description_placeholders=_DESCRIPTION_PLACEHOLDERS,
7481
)
7582

7683
async_register_admin_service(

homeassistant/components/knx/strings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@
674674
"name": "Remove event registration"
675675
},
676676
"type": {
677-
"description": "If set, the payload will be decoded as given DPT in the event data `value` key. KNX sensor types are valid values (see https://www.home-assistant.io/integrations/knx/#value-types).",
677+
"description": "If set, the payload will be decoded as given DPT in the event data `value` key. KNX sensor types are valid values (see {sensor_value_types_url}).",
678678
"name": "Value type"
679679
}
680680
},
@@ -704,7 +704,7 @@
704704
"name": "Remove exposure"
705705
},
706706
"type": {
707-
"description": "Telegrams will be encoded as given DPT. 'binary' and all KNX sensor types are valid values (see https://www.home-assistant.io/integrations/knx/#value-types).",
707+
"description": "Telegrams will be encoded as given DPT. 'binary' and all KNX sensor types are valid values (see {sensor_value_types_url}).",
708708
"name": "Value type"
709709
}
710710
},
@@ -740,7 +740,7 @@
740740
"name": "Send as Response"
741741
},
742742
"type": {
743-
"description": "If set, the payload will not be sent as raw bytes, but encoded as given DPT. KNX sensor types are valid values (see https://www.home-assistant.io/integrations/knx/#value-types).",
743+
"description": "If set, the payload will not be sent as raw bytes, but encoded as given DPT. KNX sensor types are valid values (see {sensor_value_types_url}).",
744744
"name": "Value type"
745745
}
746746
},

0 commit comments

Comments
 (0)