Hi!
Quick question - I have an Avant 55 TV and my sources response is like the cutout at the bottom (just the first few lines).
Shouldn’t the getSources code be something like this?
def getSources(self):
r = self._getReq('BeoZone/Zone/Sources')
if r:
for elements in r["sources"]:
i = 0
while i < len(r["sources"]):
self.sources.append(r["sources"][i][1]["friendlyName"])
self.sourcesID.append(r["sources"][i][0])
i += 1
Granted I am not a python expert …
BTW, I think Home Assistant automatically installed the ha-beoplay on my Rasberry Pi, but I can’t find it in /config/deps… where do I find the file to test any changes?
It’s been a while since, I worked on this. But for me the sources show up correctly. Though I only have speakers and not a TV. There might be a difference.
When you set up the custom component, it has a dependency of that python library, so it automatically downloads it from pypi. I think you can adjust that so it refers to a local library, but I can’t remember how it’s done. I would suggest to look at the home assistant dev docs. I’ll try to look there as well.
Hi Marton, I think I found the issue. PyPl has an old version of your library. Home assistant on the raspberry pi automatically downloads the code at pypl to satisfy the REQUIREMENT in the manifest, and that version is old.
You made some edits after that, but PyPl did not pick it up. Can you change the version number to 0.0.6 so that The new version of the code makes its way through the system?
Great plugin.
I have a BS35, that works perfectly with this, but for some reason i don’t get radio station or info back to HA, when i select TuneIn as source. It is shown in display on the BS35, so it must be available.
Let me know if can help you pick up some info
Hi Marton, can you also please create a release and send it to pypi (this https://pypi.org/project/ha-beoplay/ still has the old code which does not work, and it gets installed automatically by home assistant when I install the beo plugin you wrote).
I believe the pypi has not been updated yet.
In case Marton is not available at the time, is there anything we can do to get the update pushed through?
Running HA 0.113.1 i get this error after reboot:
ImportError: cannot import name ‘CancelledError’ from ‘asyncio.futures’ (/usr/local/lib/python3.8/asyncio/futures.py)
Yeah, I commented these two lines out. The exception is caught further down. The real solution is replacing the Cancelled Error with the new implementation, but I don’t know enough about python to do it.
Thanks for confirming. I’ve commented line 5 out too, but from what I can see that’s just a more specific import from the line above (my python knowledge is non existent so I’m basing this on very rusty university java!)
From digging through the source on github I found some other references to cancellation errors
import asyncio
from concurrent import futures
from functools import partial
– that futures.CancelledErrors can also occur in some situations.
CANCELLATION_ERRORS = (asyncio.CancelledError, futures.CancelledError)
Maybe this will be of more help to someone who understands the code better!
I’ve got the component running again now, I guess without this it may throw up the odd unhandled exception to the upper code but we’ll see
I checked around for some other examples of apps impacted by this change at it appeared to be that referencing the exception type explicitly solves the problem
so on line 180 instead of:
except CancelledError:
replace this with:
except asyncio.CancelledError:
I need to do some testing to see if everything is still working as expected, but so far the error messages have gone away and the devices are still showing
Hi,
I have (less than) no programming skils but i tried to change line 180 at you wrote - it did not help for me - did it help you ? or did you got the issue solved in another way?