Unifiprotect public api snapshot (#149213)

This commit is contained in:
Raphael Hehl 2025-07-24 01:37:34 +02:00 committed by GitHub
parent 40cf47ae5a
commit b966b59c09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -247,7 +247,7 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
if self.channel.is_package: if self.channel.is_package:
last_image = await self.device.get_package_snapshot(width, height) last_image = await self.device.get_package_snapshot(width, height)
else: else:
last_image = await self.device.get_snapshot(width, height) last_image = await self.device.get_public_api_snapshot()
self._last_image = last_image self._last_image = last_image
return self._last_image return self._last_image

View File

@ -396,10 +396,10 @@ async def test_camera_image(
await init_entry(hass, ufp, [camera]) await init_entry(hass, ufp, [camera])
assert_entity_counts(hass, Platform.CAMERA, 2, 1) assert_entity_counts(hass, Platform.CAMERA, 2, 1)
ufp.api.get_camera_snapshot = AsyncMock() ufp.api.get_public_api_camera_snapshot = AsyncMock()
await async_get_image(hass, "camera.test_camera_high_resolution_channel") await async_get_image(hass, "camera.test_camera_high_resolution_channel")
ufp.api.get_camera_snapshot.assert_called_once() ufp.api.get_public_api_camera_snapshot.assert_called_once()
async def test_package_camera_image( async def test_package_camera_image(