File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
homeassistant/components/airnow Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2626_LOGGER = logging .getLogger (__name__ )
2727
2828
29+ # Documentation URL for API key generation
30+ _API_KEY_URL = "https://docs.airnowapi.org/account/request/"
31+
32+
2933async def validate_input (hass : HomeAssistant , data : dict [str , Any ]) -> bool :
3034 """Validate the user input allows us to connect.
3135
@@ -114,6 +118,7 @@ async def async_step_user(
114118 ),
115119 }
116120 ),
121+ description_placeholders = {"api_key_url" : _API_KEY_URL },
117122 errors = errors ,
118123 )
119124
Original file line number Diff line number Diff line change 22 "config" : {
33 "step" : {
44 "user" : {
5- "description" : " To generate API key go to https://docs.airnowapi.org/account/request/ " ,
5+ "description" : " To generate API key go to {api_key_url} " ,
66 "data" : {
77 "api_key" : " [%key:common::config_flow::data::api_key%]" ,
88 "latitude" : " [%key:common::config_flow::data::latitude%]" ,
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ async def test_form(
2525 )
2626 assert result ["type" ] is FlowResultType .FORM
2727 assert result ["errors" ] == {}
28+ assert result ["description_placeholders" ] == {
29+ "api_key_url" : "https://docs.airnowapi.org/account/request/"
30+ }
2831
2932 result2 = await hass .config_entries .flow .async_configure (result ["flow_id" ], config )
3033 assert result2 ["type" ] is FlowResultType .CREATE_ENTRY
You can’t perform that action at this time.
0 commit comments