mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-05 23:15:07 -06:00
Don't exit the app on connection failures, expose the error in the API
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user