Skip to content

Commit

Permalink
Add optional entry of refresh token to bmw_connected_drive (home-assi…
Browse files Browse the repository at this point in the history
  • Loading branch information
rikroe committed May 3, 2023
1 parent 84d540b commit 38b51fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions custom_components/bmw_connected_drive/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)

Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion custom_components/bmw_connected_drive/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
}
},
Expand Down

0 comments on commit 38b51fe

Please sign in to comment.