From 759799acdc9319e11a18463f81113ab4a901e9f5 Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 23 Apr 2024 21:19:36 -0700 Subject: [PATCH] sleep before reconnecting after an error in listen, and fix default z-wave js server URL --- config/config.go | 2 +- zwavejs/client.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index b114bf4..15a0fcf 100644 --- a/config/config.go +++ b/config/config.go @@ -15,7 +15,7 @@ type Config struct { } var C = Config{ - ZWaveJSServer: "ws://home-assistant:3000", + ZWaveJSServer: "ws://addon_core_zwave_js:3000", SqliteDatabase: "/data/lockserver.db", HTTPBind: ":8080", } diff --git a/zwavejs/client.go b/zwavejs/client.go index ae155ee..736db7b 100644 --- a/zwavejs/client.go +++ b/zwavejs/client.go @@ -59,6 +59,7 @@ func (c *Client) DialAndListen(ctx context.Context) { } logrus.WithError(err).Error("error communicating with zwavejs server") + time.Sleep(time.Second * 5) continue } _ = c.conn.Close()