Skip to content

Commit

Permalink
config flow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrike committed Nov 14, 2018
1 parent da1e784 commit 09ef811
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions homeassistant/components/point/config_flow.py
Expand Up @@ -139,10 +139,9 @@ async def async_step_code(self, code=None):
self.hass.config_entries.flow.async_progress())
# Remove notification if no other discovery config entries in progress

return self._create_session(code)
return await self._async_create_session(code)

@callback
def _create_session(self, code):
async def _async_create_session(self, code):
"""Create point session and entries."""
from pypoint import PointSession
flow = self.hass.data[DATA_FLOW_IMPL][DOMAIN]
Expand All @@ -152,7 +151,8 @@ def _create_session(self, code):
client_id,
client_secret=client_secret,
)
token = point_session.get_access_token(code)
token = await self.hass.async_add_executor_job(
point_session.get_access_token, code)
_LOGGER.debug("Got new token")
if not point_session.is_authorized:
_LOGGER.error('Authentication Error')
Expand Down

0 comments on commit 09ef811

Please sign in to comment.