saml-dev / gome-assistant

A library that lets you write all of your Home Assistant automations in Go!
https://pkg.go.dev/saml.dev/gome-assistant
Other
84 stars 14 forks source link

Running on Home Assistant OS #20

Open darrenparkinson opened 7 months ago

darrenparkinson commented 7 months ago

Apologies, this is more of a question than an issue, but I currently only have a device running Home Assistant OS and I don't want to run another host at the moment. Do you know if it's possible to run this directly on HA? I guess it'd need something like netdaemon (godaemon?) or just a way to run compiled binaries? I'm very new to HA so just looking for pointers to not have to write python ;)

darrenparkinson commented 7 months ago

Hmm, actually, looks like netdaemon needs to run separately too. Just app daemon which has an add-on?

saml-dev commented 6 months ago

I'm pretty sure all you'd need is to wrap your automations with a docker container. The tricky part is you'd need something to watch your files and recompile/rerun your go program each time you change a file. I believe there's a project called Air for golang that will do that

darrenparkinson commented 6 months ago

Thanks, yes, seems like it. Just read the addons documentation which would allow a container. You're right though, it's the changes that are maybe difficult, although if you're testing locally and you push changes, I suppose you could do a build that would bump the version number in the config.yaml as one option. Would be nice to have something like fluxcd (without the kubernetes) where you could specify multiple repositories that would be watched and could get pulled down on change.