Fix tracebacks

This commit is contained in:
Steven Looman 2018-09-17 22:15:44 +02:00
parent c19665fed4
commit a7a16e4317

View File

@ -89,6 +89,8 @@ class UpnpFlowHandler(data_entry_flow.FlowHandler):
async def async_step_user(self, user_input=None): async def async_step_user(self, user_input=None):
"""Manual set up.""" """Manual set up."""
ensure_domain_data(self.hass)
# if user input given, handle it # if user input given, handle it
user_input = user_input or {} user_input = user_input or {}
if 'name' in user_input: if 'name' in user_input:
@ -126,10 +128,14 @@ class UpnpFlowHandler(data_entry_flow.FlowHandler):
async def async_step_import(self, import_info): async def async_step_import(self, import_info):
"""Import a new UPnP/IGD as a config entry.""" """Import a new UPnP/IGD as a config entry."""
ensure_domain_data(self.hass)
return await self._async_save_entry(import_info) return await self._async_save_entry(import_info)
async def _async_save_entry(self, import_info): async def _async_save_entry(self, import_info):
"""Store UPNP/IGD as new entry.""" """Store UPNP/IGD as new entry."""
ensure_domain_data(self.hass)
# ensure we know the host # ensure we know the host
name = import_info['name'] name = import_info['name']
discovery_infos = [info discovery_infos = [info