marthoc / kuna

Kuna Smart Home Security Custom Integration for Home Assistant
MIT License
28 stars 12 forks source link

v2021.12.0 Breaks Kuna Camera Streaming #38

Open Gpssysop opened 2 years ago

Gpssysop commented 2 years ago

After upgrading to core-2021.12.0, my Kuna cameras would no longer stream. I tried deleting and re-adding the integration, but I'm still getting the same error in the logs:

Logger: homeassistant.components.camera Source: custom_components/kuna/camera.py:100 Integration: Camera (documentation, issues) First occurred: 9:50:49 PM (2 occurrences) Last logged: 9:50:49 PM

kuna: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 684, in async_device_update await task File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/kuna/camera.py", line 100, in update self.is_streaming = True AttributeError: can't set attribute

DVarao commented 2 years ago

Ha. Thought it was just me. Looking forward to a fix, let me know if I can provide any logs etc.

mcfarlde commented 2 years ago

From Github

boctok https://github.com/boctok commented 15 hours ago https://github.com/marthoc/kuna/issues/37#issuecomment-991982953 I was able to fix the error and get the cameras back by changing line 100 in camera.py from self.is_streaming = True to self._is_streaming = True

On Dec 13, 2021, at 6:24 AM, D @.***> wrote:

Ha. Thought it was just me. Looking forward to a fix, let me know if I can provide any logs etc.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/marthoc/kuna/issues/38#issuecomment-992473005, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOJDTN7YJ3UYZ4OCKO2NPTUQXXXJANCNFSM5J5DHX4A. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Gpssysop commented 2 years ago

@mcfarlde Good call. That worked for me as well.

kevin-david commented 2 years ago

Thanks @mcfarlde for the suggestion - it worked for me as well. I created this trivial PR to keep things up to date: https://github.com/marthoc/kuna/pull/41

chheiss commented 2 years ago

I don't get any camera entities (only switches and motion) when installing the addon. Any ideas? HA 2021.12.10

smarterplace commented 2 years ago

after making the change, I am seeing this error. Any ideas?

File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 179, in _async_get_image if image_bytes := await camera.async_camera_image( TypeError: async_camera_image() got an unexpected keyword argument 'width'

ffpllc commented 1 year ago

I'm getting the same:

File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 169, in _async_get_image if image_bytes := await camera.async_camera_image( TypeError: KunaCamera.async_camera_image() got an unexpected keyword argument 'width'

mcfarlde commented 1 year ago

I updated HACS, rebooted and now the camera is back!

mcfarlde commented 1 year ago

I only get that error when using Safari. The camera works in chrome, the Mac App and the mobile app.