Skip to content

Commit 9a9f827

Browse files
authored
Move pilight URL out of strings.json (home-assistant#157967)
1 parent 855d7c6 commit 9a9f827

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

homeassistant/components/pilight/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from homeassistant.helpers.event import track_point_in_utc_time
2626
from homeassistant.helpers.typing import ConfigType
2727
from homeassistant.util import dt as dt_util
28+
from homeassistant.util.async_ import run_callback_threadsafe
2829

2930
_LOGGER = logging.getLogger(__name__)
3031

@@ -101,7 +102,18 @@ def send_code(call: ServiceCall) -> None:
101102
except OSError:
102103
_LOGGER.error("Pilight send failed for %s", str(message_data))
103104

104-
hass.services.register(DOMAIN, SERVICE_NAME, send_code, schema=RF_CODE_SCHEMA)
105+
def _register_service() -> None:
106+
hass.services.async_register(
107+
DOMAIN,
108+
SERVICE_NAME,
109+
send_code,
110+
schema=RF_CODE_SCHEMA,
111+
description_placeholders={
112+
"pilight_protocols_docs_url": "https://manual.pilight.org/protocols/index.html"
113+
},
114+
)
115+
116+
run_callback_threadsafe(hass.loop, _register_service).result()
105117

106118
# Publish received codes on the HA event bus
107119
# A whitelist of codes to be published in the event bus

homeassistant/components/pilight/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Sends RF code to Pilight device.",
55
"fields": {
66
"protocol": {
7-
"description": "Protocol that Pilight recognizes. See https://manual.pilight.org/protocols/index.html for supported protocols and additional parameters that each protocol supports.",
7+
"description": "Protocol that Pilight recognizes. See {pilight_protocols_docs_url} for supported protocols and additional parameters that each protocol supports.",
88
"name": "Protocol"
99
}
1010
},

0 commit comments

Comments
 (0)