core: Onkyo mediaplayer intergration generates errors
The problem
the logger generates errors:
UnboundLocalError: local variable ‘video_information_raw’ referenced before assignment
What is version of Home Assistant Core has the issue?
core-2021.3.4
What type of installation are you running?
Home Assistant Container
Integration causing the issue
onkyo
Link to integration documentation on our website
https://www.home-assistant.io/integrations/onkyo/
Anything in the logs that might be useful for us?
Logger: homeassistant.helpers.entity
Source: components/onkyo/media_player.py:346
First occurred: 22:28:25 (15 occurrences)
Last logged: 22:30:45
Update for media_player.tx_nr525_00xxb0xxx324 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 277, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 473, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py", line 346, in update
self._parse_video_information(video_information_raw)
UnboundLocalError: local variable 'video_information_raw' referenced before assignment
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (2 by maintainers)
Awesome! That seems to do the trick, thanks @mahk8! @quadhammer I did a bit different trick, and hopefully you can follow the same: Instead of modifying existing component, I copied the
onkyo
component to myconfig/custom_components/
directory. From:https://github.com/home-assistant/core/tree/dev/homeassistant/components/onkyo
. And assigned values of empty list to audio_information_raw/video_information_raw values as suggested by @mahk8After HA restart, it surely took the ‘custom’ component, the only disadvantage at this point is this warning:
No 'version' key in the manifest file for custom integration 'onkyo'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'onkyo'
But I hope before 2021.6 is released, this workaround will not be needed. And if so… I suppose adding simple ‘version’ key to manifest file should do the trick as well. Hope that helps.
No need to reply to do that, you can just use the “subscribe” button on the right side ->
If you’ve created your own custom version and you’ve copied the original source directory then just add the following line to the manifest.json file. Insert the “version” key after the “name” key and make sure everything lines up.
"version": "0.0.0",
This should get rid of the “version key” nag and allows the custom integration to load.
Check the following link for explanation: https://developers.home-assistant.io/docs/creating_integration_manifest/#version
Until the author fixes this issue, you can get rid of those pesky error message by add the following to “/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py” so to initialise the audio_information_raw and video_information_raw before it uses it.
Place it before line 314 in the file and line up the indentation. Should look something like…
I’m still not getting sources updating even with the latest build of Home Assistant.
System Health
Home Assistant Community Store
Home Assistant Cloud
Home Assistant Supervisor
Lovelace