Skip to content

Commit

Permalink
fix: requesting camera height and width (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 authored Sep 9, 2021
2 parents d147e93 + 90eecc1 commit ce49757
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion custom_components/mail_and_packages/camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Camera that loads a picture from a local file."""
from __future__ import annotations

import logging
import os

Expand Down Expand Up @@ -104,7 +106,9 @@ def __init__(
else config.data.get(CONF_CUSTOM_IMG_FILE)
)

async def async_camera_image(self):
async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return image response."""
try:
with open(self._file_path, "rb") as file:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import quopri
import re
import subprocess
import subprocess # nosec
import uuid
from email.header import decode_header
from shutil import copyfile, copytree, which
Expand Down

0 comments on commit ce49757

Please sign in to comment.