roleoroleo / yi-hack_ha_integration

Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner, yi-hack-Allwinner-v2, yi-hack-v5 and sonoff-hack
GNU General Public License v3.0
205 stars 32 forks source link

Browsing yi-hack media source in HA throws error #105

Closed Failure404 closed 2 months ago

Failure404 commented 1 year ago

Hi I am experiencing this error when I try to browse yi-hack media files in Home Assistant:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 170, in websocket_browse_media
    media = await async_browse_media(hass, msg.get("media_content_id", ""))
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 121, in async_browse_media
    item = await _get_media_item(hass, media_content_id, None).async_browse()
  File "/usr/src/homeassistant/homeassistant/components/media_source/models.py", line 79, in async_browse
    return await self.async_media_source().async_browse_media(self)
  File "/config/custom_components/yi_hack/media_source.py", line 71, in async_browse_media
    device_registry = await self.hass.helpers.device_registry.async_get()
TypeError: async_get() missing 1 required positional argument: 'hass'
roleoroleo commented 1 year ago

Probably it's a mismatch with the versions. What version of ha are you using?

Failure404 commented 1 year ago

Sorry for not mentioning it, I am using 2023.1.2 now and the problem also occured on 2023.1.1.

roleoroleo commented 1 year ago

Now i remember. The problem is fixed here https://github.com/roleoroleo/yi-hack_ha_integration/commit/9910c442ff8023c5115edcc56f7836b8e0cff70e but not yes released.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.