File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
homeassistant/components/teslemetry Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,22 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
7474 return True
7575
7676
77+ def beta_migration_fix (hass : HomeAssistant , entry : TeslemetryConfigEntry ):
78+ """Fix beta migration issues."""
79+ # This is needed to migrate beta users to the new OAuth credential system.
80+ if "auth_implementation" not in entry .data :
81+ hass .config_entries .async_update_entry (
82+ entry ,
83+ data = {** entry .data , "auth_implementation" : DOMAIN },
84+ )
85+
86+
7787async def async_setup_entry (hass : HomeAssistant , entry : TeslemetryConfigEntry ) -> bool :
7888 """Set up Teslemetry config."""
7989
8090 session = async_get_clientsession (hass )
8191
92+ beta_migration_fix (hass , entry )
8293 implementation = await async_get_config_entry_implementation (hass , entry )
8394 oauth_session = OAuth2Session (hass , entry , implementation )
8495
You can’t perform that action at this time.
0 commit comments