diff --git a/internal/homeassistant/subscriber.go b/internal/homeassistant/subscriber.go index bdddd4f..4fa4a13 100644 --- a/internal/homeassistant/subscriber.go +++ b/internal/homeassistant/subscriber.go @@ -156,8 +156,7 @@ func handleMessages() { data, _ := json.Marshal(message.Event.Data) nats.Publish(fmt.Sprintf("homeassistant.zwave-scene.%s", message.Event.Data.DeviceId), data) case timerFinishedEventId: - // nats.PublishString(fmt.Sprintf("homeassistant.%s.finished", message.Event.Data.EntityId), "finished") - nats.PublishRequest(fmt.Sprintf("homeassistant.%s.finished", message.Event.Data.EntityId), []byte("finished"), 500*time.Millisecond, 3) + go nats.PublishRequest(fmt.Sprintf("homeassistant.%s.finished", message.Event.Data.EntityId), []byte("finished"), 500*time.Millisecond, 3) } } } diff --git a/internal/nats/client.go b/internal/nats/client.go index 8b5889f..db341f8 100644 --- a/internal/nats/client.go +++ b/internal/nats/client.go @@ -94,7 +94,7 @@ func PublishRequest(subject string, message []byte, timeout time.Duration, retri resp, err := client.Conn.Request(subject, message, timeout) if err == nil { - logger.Debug("Request response received", "response", string(resp.Data)) + logger.Debug("Request response received", "response", string(resp.Data), "attempts", attempts) return } }