mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Unifiprotect public api snapshot (#149213)
This commit is contained in:
parent
40cf47ae5a
commit
b966b59c09
@ -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
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user