Skip to content

Commit

Permalink
Run fetching async
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Jan 9, 2021
1 parent 9d4d44e commit 53d48a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/tv4_play/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ async def play_suggested(service):
entity_id = service.data.get(CONF_ENTITY_ID)
program_name = service.data.get(CONF_PROGRAM_NAME)

video_url = get_video_url(get_suggested_episode(program_name))
suggested_episode = await hass.async_add_executor_job(get_suggested_episode, program_name)
video_url = await hass.async_add_executor_job(get_video_url, suggested_episode)

service_data = {
'entity_id': entity_id,
Expand Down

0 comments on commit 53d48a7

Please sign in to comment.