1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Cast/Sonos: create config entry if manually configured (#15630)

* Cast/Sonos: create config entry if manually configured

* Add test for helper
This commit is contained in:
Paulus Schoutsen
2018-07-23 15:08:03 +02:00
committed by GitHub
parent f3dfc433c2
commit 3204501174
6 changed files with 109 additions and 2 deletions

View File

@@ -72,6 +72,18 @@ class DiscoveryFlowHandler(data_entry_flow.FlowHandler):
return await self.async_step_confirm()
async def async_step_import(self, _):
"""Handle a flow initialized by import."""
if self._async_in_progress() or self._async_current_entries():
return self.async_abort(
reason='single_instance_allowed'
)
return self.async_create_entry(
title=self._title,
data={},
)
@callback
def _async_current_entries(self):
"""Return current entries."""