homeassistant-config: Amcrest streaming broken in 0.91.0

custom Amcrest component will load OK under .91.0, snapshots in preview are OK, but streaming is completely broken. Numerous errors (logs below). 91.0 release notes show an update to Amcrest was made to SUPPORT_STREAM.

I temporarily removed the custom Amcrest code and tried the official. It won’t even load! I won’t list those errors here since that’s not relevant to the custom code. Looks like I will either have to back out to .90 or hope .91.1 fixes it.

2019-04-05 10:04:06 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/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 114, in handle
    result = await result
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 475, in get
    return await self.handle(request, camera)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 511, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/amcrest/camera.py", line 206, in handle_async_mjpeg_stream
    from haffmpeg import CameraMjpeg
ImportError: cannot import name 'CameraMjpeg' from 'haffmpeg' (/usr/local/lib/python3.7/site-packages/haffmpeg/__init__.py)
2019-04-05 10:04:34 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/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 114, in handle
    result = await result
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 475, in get
    return await self.handle(request, camera)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 511, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/amcrest/camera.py", line 206, in handle_async_mjpeg_stream
    from haffmpeg import CameraMjpeg
ImportError: cannot import name 'CameraMjpeg' from 'haffmpeg' (/usr/local/lib/python3.7/site-packages/haffmpeg/__init__.py)
2019-04-05 10:04:43 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/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 114, in handle
    result = await result
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 475, in get
    return await self.handle(request, camera)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 511, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/amcrest/camera.py", line 206, in handle_async_mjpeg_stream
    from haffmpeg import CameraMjpeg
ImportError: cannot import name 'CameraMjpeg' from 'haffmpeg' (/usr/local/lib/python3.7/site-packages/haffmpeg/__init__.py)
2019-04-05 10:05:02 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/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 114, in handle
    result = await result
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 475, in get
    return await self.handle(request, camera)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 511, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/amcrest/camera.py", line 206, in handle_async_mjpeg_stream
    from haffmpeg import CameraMjpeg
ImportError: cannot import name 'CameraMjpeg' from 'haffmpeg' (/usr/local/lib/python3.7/site-packages/haffmpeg/__init__.py)
2019-04-05 10:07:59 ERROR (MainThread) [aiohttp.server] Error handling request

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

Oh crap, I just moved amcrest folder out of custom_components back 1 level (config/amcrest) thinking that would remove it from loading pattern. I didn’t realize HA would also look in config folder too.

will take care of this oversight right now…