Silvenga / unifi-udm-api-proxy

A compatibility shim to support accessing the new UnifiOs API.
MIT License
11 stars 5 forks source link

Snapshots Don’t Work #5

Closed Veldkornet closed 4 years ago

Veldkornet commented 4 years ago

When making a snapshot from HomeAssistant, I seem to be getting the following error:

2020-02-24 20:39:35 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 485, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 502, in handle
    image = await camera.async_camera_image()
  File "/config/custom_components/unifiprotect/camera.py", line 165, in async_camera_image
    last_image = self.upv_object.get_snapshot_image(self._camera_id)
  File "/config/custom_components/unifiprotect/unifi_protect_server.py", line 270, in get_snapshot_image
    access_key = self._get_api_access_key()
  File "/config/custom_components/unifiprotect/unifi_protect_server.py", line 97, in _get_api_access_key
    "Request failed: %s - Reason: %s" % (response.status, response.reason)
AttributeError: 'Response' object has no attribute 'status'
Veldkornet commented 4 years ago

Also, if you have the camera’s added to the picture entity card, no image is shown and it gives the same error.

Silvenga commented 4 years ago

Blah, I know why. Hopefully I have time soon, need to dedicate some maintenance time to a different OSS project. Feel free to ping me if I forget.

Silvenga commented 4 years ago

Fixed v1.2.0, I can't believe I didn't catch this. Feel free to re-open if it's not fixed.