From 90eecc110429e99cf8d5fa216a4901659ed1d9bf Mon Sep 17 00:00:00 2001 From: firstof9 Date: Thu, 9 Sep 2021 12:59:39 -0700 Subject: [PATCH] fix: requesting camera height and width --- custom_components/mail_and_packages/camera.py | 6 +++++- custom_components/mail_and_packages/helpers.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/custom_components/mail_and_packages/camera.py b/custom_components/mail_and_packages/camera.py index 12f16de2..910ee7e3 100644 --- a/custom_components/mail_and_packages/camera.py +++ b/custom_components/mail_and_packages/camera.py @@ -1,4 +1,6 @@ """Camera that loads a picture from a local file.""" +from __future__ import annotations + import logging import os @@ -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: diff --git a/custom_components/mail_and_packages/helpers.py b/custom_components/mail_and_packages/helpers.py index a91978e0..dea25d2b 100644 --- a/custom_components/mail_and_packages/helpers.py +++ b/custom_components/mail_and_packages/helpers.py @@ -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