Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Jun 22, 2024
1 parent 28079d2 commit 028c815
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 3 additions & 1 deletion custom_components/mail_and_packages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ async def _async_update_data(self):
"""Fetch data."""
async with asyncio.timeout(self.timeout):
try:
data = await self.hass.async_add_executor_job(process_emails, self.hass, self.config)
data = await self.hass.async_add_executor_job(
process_emails, self.hass, self.config
)
except Exception as error:
_LOGGER.error("Problem updating sensors: %s", error)
raise UpdateFailed(error) from error
Expand Down
8 changes: 1 addition & 7 deletions custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,7 @@ def image_file_name(
_LOGGER.debug("Created: %s, Today: %s", created, today)
# If image isn't mail_none and not created today,
# return a new filename
if (
sha1
!= hash_file(
os.path.join(path, file)
)
and today != created
):
if sha1 != hash_file(os.path.join(path, file)) and today != created:
image_name = f"{str(uuid.uuid4())}{ext}"
else:
image_name = file
Expand Down

0 comments on commit 028c815

Please sign in to comment.