Closed Proxx closed 3 years ago
FYI: It looks like the async update will fix this issue: https://github.com/winterscar/core/pull/6 That patch is part of a larger PR, so my guess is that it might reach 2012.4.1 (hopefully! I'm not up to date on the lifecycle...)
Just to confirm: 2021.4 hasn't fixed it yet, so hopefully 2021.4.1 will do the trick.
Everything works pretty well, except for the source being updated.
eg. I can change my source to video1, but if I query it in node red, it might report something like:
source: "tape-1_tv/tape"
The same thing happens with the card in home assistant.
Edit: still no luck with 2021.4.3
Are you saying this is the case after the fix, or right now @quadhammer ?
Everything works pretty well, except for the source being updated.
Mine gives that error constantly right now and nothing updates in Home Assistant. Mine is an Integra DTR 50.2.
I'm still not getting sources updating even with the latest build of Home Assistant.
Logger: homeassistant.components.media_player
Source: /usr/local/lib/python3.8/asyncio/events.py:81
Integration: Media player (documentation, issues)
First occurred: 1:59:46 PM (1 occurrences)
Last logged: 1:59:46 PM
Setup of media_player platform onkyo is taking over 10 seconds.
Logger: homeassistant.helpers.entity
Source: components/onkyo/media_player.py:346
First occurred: 2:00:01 PM (17 occurrences)
Last logged: 2:01:41 PM
Update for media_player.prepro fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, 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_audio_information(audio_information_raw)
UnboundLocalError: local variable 'audio_information_raw' referenced before assignment
version | core-2021.4.4 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
virtualenv | false |
python_version | 3.8.7 |
os_name | Linux |
os_version | 5.4.109 |
arch | x86_64 |
timezone | Australia/Brisbane |
Hi,
I'm still having this issue (both: audio_information_raw/video_information_raw) within core-2021.4.6
AS a workaround, is there a way to 'disable' even temporary, getting the source updating? Since that produces couple of thousands errors every day in my logs.. Example error on my side:
Logger: homeassistant.helpers.entity
Source: components/onkyo/media_player.py:346
First occurred: April 29, 2021, 1:35:47 PM (2627 occurrences)
Last logged: 1:06:36 AM
Update for media_player.pioneer fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, 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_audio_information(audio_information_raw)
UnboundLocalError: local variable 'audio_information_raw' referenced before assignment
It seems the workaround would be to work on
File "/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py", line 346, in update
self._parse_audio_information(audio_information_raw)
And corresponding line for video_information_raw. However I have no experience with manually editing those files, not sure if that won't break integrity in my HA, or prevent me from doing the updates?
I'm still having this issue (both: audio_information_raw/video_information_raw) within core-2021.4.6
Same here, core-2021.4.6 still hasn't fixed it. I've just totally disabled the plug-in from the configuration.yaml until someone finds a way to make it work. A fix was mentioned on 17 March by @danieljkemp , so it's taking a long time to make it into the release.
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...
current_source_raw = self.command("input-selector query")
audio_information_raw = []
video_information_raw = []
`
"/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py"
Unfortunately I'm using a virtual machine, Oracle VM virtualbox, so I don't think I can get in there and change those files. They don't seem to be exposed by my Samba share.
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 my config/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 @mahk8
After 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.
https://github.com/home-assistant/core/tree/dev/homeassistant/components/onkyo
Just for others trying to do this, you have to go to the root directory to find the download file button, i.e. https://github.com/home-assistant/core
Then code, download.zip
then you can just extract it, and search for the Onkyo folder, and follow @ontaptom 's excellent instructions.
One other caveat, make sure when you copy and paste
audio_information_raw = []
video_information_raw = []
they are all spaces beforehand, and not tabs, or it won't work.
Thanks for everyone's help in here. It's good to have it working!
Any chance of the author or maintainer adding these two lines for the next release?
This is such an easy fix so that we don't have to re-edit the existing file or maintain a custom version of the code.
We need a version key too, just to use the hacked component one above.
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
I have the same issue. Registering for notifications.
I have the same issue. Registering for notifications.
No need to reply to do that, you can just use the "subscribe" button on the right side ->
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?
commit #46228 has fixed #46130 but introduced this error