Pass width and height when requesting camera snapshot (#53835)

This commit is contained in:
J. Nick Koston
2021-08-10 19:33:06 -05:00
committed by GitHub
parent 390023a576
commit e99576c094
53 changed files with 418 additions and 113 deletions

View File

@@ -1,4 +1,6 @@
"""Support for Homekit cameras."""
from __future__ import annotations
from aiohomekit.model.services import ServicesTypes
from homeassistant.components.camera import Camera
@@ -21,12 +23,14 @@ class HomeKitCamera(AccessoryEntity, Camera):
"""Return the current state of the camera."""
return "idle"
async def async_camera_image(self):
async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return a jpeg with the current camera snapshot."""
return await self._accessory.pairing.image(
self._aid,
640,
480,
width or 640,
height or 480,
)