Skip to content
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

added hass_is_global config parameter #51

Merged
merged 2 commits into from
Oct 21, 2020
Merged

added hass_is_global config parameter #51

merged 2 commits into from
Oct 21, 2020

Conversation

craigbarratt
Copy link
Member

This PR adds a config parameter hass_is_global (default False), which if set provides hass as a global variable in all pyscript contexts.

@raman325 and @dlashua - I invited you to the forked repository. Please review and feel free to push any changes to craigbarratt/pyscript-hass-is-global, or just comment here.

This will resolve #46.

@raman325
Copy link
Contributor

I just pushed the change I had suggested here: #42 (comment)

@craigbarratt
Copy link
Member Author

Thanks! Should that also be done in __init__.py (it's aways used cv.boolean)?

@raman325
Copy link
Contributor

no cv.boolean can be used there because the backend is aware of the custom config validators that HA provides. The issue is that the serializer that delivers the schema to the frontend (for config and option flows) was not aware of the custom validator before I submitted that PR, so it doesn't know what to do and throws an error instead of showing a form.

@craigbarratt
Copy link
Member Author

Ok, thanks for the explanation.

@dlashua
Copy link
Contributor

dlashua commented Oct 21, 2020

I've loaded this branch and it seems to work fine with no issues. I haven't found anything interesting to do with hass just yet, but the things I expect to be there are there and are usable.

@craigbarratt
Copy link
Member Author

Thanks for the feedback and fixes. I just released 0.32 (which has the HASS restart fix, config improvements from @raman325 and @state_trigger support for multiple arguments, lists and plain state variables to mean any). I'm going to merge this and we have time to test and tweak if necessary.

@craigbarratt craigbarratt merged commit 0c1e929 into custom-components:master Oct 21, 2020
@dlashua
Copy link
Contributor

dlashua commented Oct 21, 2020

excellent, I'll pull master now so it gets a good test run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: access to sunset/sunrise in function
3 participants