Skip to content

Commit

Permalink
fix: fix blocking call in amazon_search function (moralmunky#909)
Browse files Browse the repository at this point in the history
* fix: fix blocking call in `amazon_search` function

* formatting
  • Loading branch information
firstof9 authored Jun 9, 2024
1 parent 926fbdc commit 8608d22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,14 @@ def amazon_search(
if server_response == "OK" and data[0] is not None:
count += len(data[0].split())
_LOGGER.debug("Amazon delivered email(s) found: %s", count)
get_amazon_image(data[0], account, image_path, hass, amazon_image_name)
hass.async_add_executor_job(
get_amazon_image,
data[0],
account,
image_path,
hass,
amazon_image_name,
)

return count

Expand Down

0 comments on commit 8608d22

Please sign in to comment.