Custom python and python_packages in AD

Hi there,

I started using AppDaemon short time ago, and I really love it! Seems very powerful and very easy to grasp, even for me who still isn’t fluent in Python. One of the greatest things from my point of view is the extremely convenient way of just saving the file and immediately you have the result - no need to restart HA, wait forever just to find out you had a typo or other silly mistake and then repeat this ten times until you’re there (probably says more about my practice though…). Anyways, my question:

I am aware of the “python_packages” input I can give to the AppDaemon plugin, and if I understand it correctly it is limited to packages found on PyPI.org? Correct? My real question is if it is possible to simply have local python files (for instance found on Github and slightly modified) in a similar way or if they have to be on PyPI?

Cheers!

Can you show an example of such a file? You can just put the code in a pythom file and then import it in your app.

That simple? Just put any python class file together with the apps and import it in an app? I’ll give it a try. Thanks.

Seems like you’re perfectly right, can’t believe I didn’t see that. I tried it before posting, but somehow I must have done something stupid because it didn’t work for me the first time. When I tried now, I only got it to work when I had the imported files in a subfolder and did “import.subfolder.file class”. Guess I didn’t do that the first time I tried, I just put a file together with the apps files.

Does that sound correct? That imports need to be in separate folders, or am I just doing something wrong? Anyways, my problem is solved. Thanks for your help.