-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for state.persist #332
Conversation
The failing tests are due to the use of internal class properties externally. The correct way to handle is it to write a class that extends RestoreEntity and provides methods to set these properties. However, as is, it should resolve the 2022.3 compatibility issues. Then, after some thought on how to implement this in a way that exposes entities to userland pyscripts, this temporary fix can be adjusted to fit in line with that plan. |
Made the changes to my state.py, and can confirm it works... |
@dlashua - thanks for the patch! Couple of questions:
|
I don't think so.
According to the release notes, no. But, the issue fixed here is also not mentioned in the release notes, so maybe? I've not upgraded to 2022.3 yet, due to a lack of time. I just recently upgraded to 2022.2. |
Oh my... all tests finally passed. |
I'm not sure how to detect the HA version, although hopefully it is easy. One approach would be to use try/except clauses to handle the new and old cases (which has the advantage that we don't need to explicitly test for the HA version). |
After I finished fixing all the test failures, this will no longer load in Home Assistant. ERROR (MainThread) [homeassistant.setup] Setup failed for pyscript: Integration not found. But the files are in the right place (the same place they were in when I was testing the code changes). I have debug logging turned on and it's not providing any additional information. So... I'm not sure how I broke whatever is now broken. I even deleted everything, recloned Home Assistant, and recloned the Pyscript component and I still have the same issue. I'm out of time for now, perhaps @craigbarratt can figure out what went wrong? |
Apparently the devcontainer got corrupted somehow. I have resolved that issue and this loads fine now. |
This is now compatible with HASS Versions < 2022.3.0. I tested with 2022.2.9, but unless really old versions used some other method of restoring state, this should work. |
I am now successfully running this in my "production" Home Assistant on version 2022.2.9. For those needing a quick fix until this issue is ironed out and merged, you can install the master branch of github.com/dlashua/pyscript. If you use HACS, you can add this repo as a custom repository (it will show up as |
I am now successfully running HASS 2022.3.1 without issues. |
Thanks for the fix I'm going to upgrade some of the versions in In particular, |
fixes #331