Don't exit the app on connection failures, expose the error in the API

This commit is contained in:
Lubos Dolezel
2023-03-07 18:30:40 +01:00
parent 23f87fef8b
commit 754ffafeae
3 changed files with 31 additions and 11 deletions

View File

@@ -10,11 +10,16 @@ import (
)
func main() {
app := ga.NewApp(ga.NewAppRequest{
app, err := ga.NewApp(ga.NewAppRequest{
IpAddress: "192.168.86.67", // Replace with your Home Assistant IP Address
HAAuthToken: os.Getenv("HA_AUTH_TOKEN"),
HomeZoneEntityId: "zone.home",
})
if err != nil {
log.Fatalln("Error connecting to HASS:", err)
}
defer app.Cleanup()
pantryDoor := ga.