From 38b51fe4ae5fdb232c1f43190a96ce2f7809a619 Mon Sep 17 00:00:00 2001 From: rikroe Date: Wed, 3 May 2023 22:53:59 +0200 Subject: [PATCH] Add optional entry of refresh token to bmw_connected_drive (home-assistant/core#91427) --- custom_components/bmw_connected_drive/config_flow.py | 2 ++ custom_components/bmw_connected_drive/strings.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/bmw_connected_drive/config_flow.py b/custom_components/bmw_connected_drive/config_flow.py index eb58a6c..c522aa3 100644 --- a/custom_components/bmw_connected_drive/config_flow.py +++ b/custom_components/bmw_connected_drive/config_flow.py @@ -23,6 +23,7 @@ vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str, vol.Required(CONF_REGION): vol.In(CONF_ALLOWED_REGIONS), + vol.Optional(CONF_REFRESH_TOKEN): str, } ) @@ -38,6 +39,7 @@ async def validate_input( data[CONF_USERNAME], data[CONF_PASSWORD], get_region_from_name(data[CONF_REGION]), + refresh_token=data.get(CONF_REFRESH_TOKEN), ) try: diff --git a/custom_components/bmw_connected_drive/strings.json b/custom_components/bmw_connected_drive/strings.json index 506175b..8b1ff55 100644 --- a/custom_components/bmw_connected_drive/strings.json +++ b/custom_components/bmw_connected_drive/strings.json @@ -5,7 +5,8 @@ "data": { "username": "[%key:common::config_flow::data::username%]", "password": "[%key:common::config_flow::data::password%]", - "region": "ConnectedDrive Region" + "region": "ConnectedDrive Region", + "refresh_token": "Refresh token (optional)" } } },