3 ms·
For what it's worth, I don't use the Jupyter notebooks. Just have a folder somewhere with python scripts that get reloaded as I edit them.
by dingledork69 3y ago
For what it's worth, I don't use the Jupyter notebooks. Just have a folder somewhere with python scripts that get reloaded as I edit them.
- Larrikin 3y agoI've found that it just feels like I'm fighting a river to go up stream if I don't incorporate the web browser + Jupyter work flow that the author likes. Auto complete for discovery just refuses to work in PyCharm and VSCode for me. The way PyScript is setup seems to be a strange bespoke system that kind of breaks the import system between files, type safety only sort of works sometimes, and just other quirks where I seem to just have to get used to all of the red underlines if I want to use an IDE as part of my development process. But it still seems to be best option for allowing me to use any libraries in the ecosystem, gets rid of boilerplate, and the author is actively maintaining it. I didn't really find any other viable options outside of Python that would let me actually code my automations without yaml or a GUI. I was very excited when I found a Kotlin implementation, KHome, but by the time I found it, it was already a seemingly dead project.
- dingledork69 3y agoIf you are expecting auto discovery of state variables or service calls then that would be nice, but that seems like a bit too much to ask. And it's not something that I personally feel is necessary as you're likely already are familiar enough with the home assistant states/services that you want to interact with by checking them out in the home assistant developer UI. My PyCharm just shows those types as unknown, not as errors. I get auto completion & type checking for all the code I write myself. It's also important to note that PyScript isn't regular python. Instead it's an interpreted script[1] that is compatible with the Python syntax. This is unfortunate, but enables most of the magic of PyScript which otherwise would not be practical. [1] https://github.com/custom-components/pyscript/blob/master/custom_components/pyscript/eval.py https://github.com/custom-components/pyscript/blob/master/cu...
- Larrikin 3y agoThe thing is, the Jupyter notebook does support auto discovery/complete of all of the state variables and services, but only in the browser. Not even in the notebook running inside the IDE. It's just maddening that I can't seem to figure out how to get that one part working. I end up using a mix of the notebook and going through the developer UI, but wish I could figure out that one quirk.