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

Support for pyscript #63

Open
adwuk opened this issue Nov 3, 2022 · 0 comments
Open

Support for pyscript #63

adwuk opened this issue Nov 3, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@adwuk
Copy link

adwuk commented Nov 3, 2022

I have been using pyscript for my automations, as well as YAML. I thought that I would mention that watchman does a pretty good job of scanning python files and detecting problems as well. Essentially the easiest way to use pyscript is to put all your python files into the /config/pyscript directory. I have added the following to init.py to get it working. You may want to provide it as an option for others.

def get_included_folders(hass):
...
    folders.append(os.path.join(hass.config.config_dir, "pyscript/*.py"))

The one thing that it doesn't cope with is pyscript's ability to refer to attributes in the same definition, e.g. entity.attribute, but other than that, 10/10! Thanks - great utility.

@dummylabs dummylabs added the enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants