Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 861f4a0

Browse files
Move url out of orsoenergy strings.json (home-assistant#154776)
1 parent a82c512 commit 861f4a0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎homeassistant/components/osoenergy/config_flow.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
_LOGGER = logging.getLogger(__name__)
1717
_SCHEMA_STEP_USER = vol.Schema({vol.Required(CONF_API_KEY): str})
1818

19+
CONF_PORTAL_URL = "portal_url"
20+
OSOENERGY_PORTAL_URL = "https://portal.osoenergy.no/"
21+
1922

2023
class OSOEnergyFlowHandler(ConfigFlow, domain=DOMAIN):
2124
"""Handle a OSO Energy config flow."""
@@ -45,6 +48,7 @@ async def async_step_user(self, user_input=None) -> ConfigFlowResult:
4548
step_id="user",
4649
data_schema=_SCHEMA_STEP_USER,
4750
errors=errors,
51+
description_placeholders={CONF_PORTAL_URL: OSOENERGY_PORTAL_URL},
4852
)
4953

5054
async def get_user_email(self, subscription_key: str) -> str | None:
@@ -66,4 +70,5 @@ async def async_step_reauth(
6670
data_schema=self.add_suggested_values_to_schema(
6771
_SCHEMA_STEP_USER, self._get_reauth_entry().data
6872
),
73+
description_placeholders={CONF_PORTAL_URL: OSOENERGY_PORTAL_URL},
6974
)

‎homeassistant/components/osoenergy/strings.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"step": {
44
"user": {
55
"title": "OSO Energy auth",
6-
"description": "Enter the 'Subscription key' for your account generated at 'https://portal.osoenergy.no/'",
6+
"description": "Enter the 'Subscription key' for your account generated at {portal_url}",
77
"data": {
88
"api_key": "[%key:common::config_flow::data::api_key%]"
99
}
1010
},
1111
"reauth": {
1212
"title": "OSO Energy auth",
13-
"description": "Enter a new 'Subscription key' for your account generated at 'https://portal.osoenergy.no/'.",
13+
"description": "Enter a new 'Subscription key' for your account generated at {portal_url}",
1414
"data": {
1515
"api_key": "[%key:common::config_flow::data::api_key%]"
1616
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /