Skip to content

Commit 26fec2f

Browse files
authored
Move Electricity Maps url out of strings.json (home-assistant#154284)
1 parent 13e8280 commit 26fec2f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

homeassistant/components/co2signal/config_flow.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838

3939
_LOGGER = logging.getLogger(__name__)
4040

41+
DESCRIPTION_PLACEHOLDER = {
42+
"register_link": "https://electricitymaps.com/free-tier",
43+
}
44+
4145

4246
class ElectricityMapsConfigFlow(ConfigFlow, domain=DOMAIN):
4347
"""Handle a config flow for Co2signal."""
@@ -70,6 +74,7 @@ async def async_step_user(
7074
return self.async_show_form(
7175
step_id="user",
7276
data_schema=data_schema,
77+
description_placeholders=DESCRIPTION_PLACEHOLDER,
7378
)
7479

7580
data = {CONF_API_KEY: user_input[CONF_API_KEY]}
@@ -179,4 +184,5 @@ async def _validate_and_create(
179184
step_id=step_id,
180185
data_schema=data_schema,
181186
errors=errors,
187+
description_placeholders=DESCRIPTION_PLACEHOLDER,
182188
)

homeassistant/components/co2signal/quality_scale.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ rules:
1818
status: todo
1919
comment: |
2020
The config flow misses data descriptions.
21-
Remove URLs from data descriptions, they should be replaced with placeholders.
2221
Make use of Electricity Maps zone keys in country code as dropdown.
2322
Make use of location selector for coordinates.
2423
dependency-transparency: done

homeassistant/components/co2signal/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"location": "[%key:common::config_flow::data::location%]",
77
"api_key": "[%key:common::config_flow::data::access_token%]"
88
},
9-
"description": "Visit https://electricitymaps.com/free-tier to request a token."
9+
"description": "Visit the [Electricity Maps page]({register_link}) to request a token."
1010
},
1111
"coordinates": {
1212
"data": {

0 commit comments

Comments
 (0)