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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user