Ignore smartthings storage on fresh install (#98418)
* Ignore smartthings storage on fresh install * Also unload existing things when going for clean install * Rename param * Fix tests
This commit is contained in:
parent
e3438baf49
commit
ced4af1e22
4 changed files with 19 additions and 7 deletions
|
@ -50,6 +50,7 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
self.installed_app_id = None
|
||||
self.refresh_token = None
|
||||
self.location_id = None
|
||||
self.endpoints_initialized = False
|
||||
|
||||
async def async_step_import(self, user_input=None):
|
||||
"""Occurs when a previously entry setup fails and is re-initiated."""
|
||||
|
@ -57,7 +58,11 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_user(self, user_input=None):
|
||||
"""Validate and confirm webhook setup."""
|
||||
await setup_smartapp_endpoint(self.hass)
|
||||
if not self.endpoints_initialized:
|
||||
self.endpoints_initialized = True
|
||||
await setup_smartapp_endpoint(
|
||||
self.hass, len(self._async_current_entries()) == 0
|
||||
)
|
||||
webhook_url = get_webhook_url(self.hass)
|
||||
|
||||
# Abort if the webhook is invalid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue