Open tal opened 1 year ago
Duplicates #500, #501, #502, #504, #505. Upgrade to pyscript 1.5.0.
I am on Home Assistant 2023.8.1 running in a Docker Container and using pyscript 1.5.0 and I am still having issues:
[homeassistant.setup] Setup failed for custom integration pyscript: Unable to import component: cannot import name 'Event' from 'homeassistant.helpers.event' (/usr/src/homeassistant/homeassistant/helpers/event.py)
The relevant part of the log can be found attached.
I have restarted everything, pulled the latest Docker container and reinstalled pyscript, all with no effect. Any suggestions on what to try?
You do say you are running 1.5.0, but I just can't see how that error could happen with 1.5.0. Is there any chance you are not really running 1.5.0? Can you check the installed code in custom_components/pyscript/manifest.json
? Also, in custom_components/pyscript/__init__.py
, do you see a line like this:
from homeassistant.core import Event as HAEvent
If you see that code, then you are running 1.5.0.
EDIT:
I am sorry...of course the error was on my side, but looking at the custom components folder as per your instructions helped me find the mistake...
For some reason, there were two copies of pyscript in the custom components directory:
For some reason it would automatically pick the old one...
After deleting that things seem to be running normally...
Yes, that is 1.5.0.
However, from the log file, you can see the error is coming from this file: /config/custom_components/pyscript_old/__init__.py
, which presumably is an old version, I would guess manually copied?
Edit - I wrote and posted this before I saw your confirmation. Glad the problem is solved.
Seems like it's unable to handle the new event type of entity: