Skip to content

Commit 61ffe78

Browse files
committed
fix: set CleanSession to false
1 parent 05f17db commit 61ffe78

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/hc-motion-sensor/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func connect(clientID string, uri *url.URL) (mqtt.Client, error) {
2525
password, _ := uri.User.Password()
2626
opts.SetPassword(password)
2727
opts.SetClientID(clientID)
28+
opts.SetCleanSession(false)
2829

2930
var client = mqtt.NewClient(opts)
3031
var token = client.Connect()

0 commit comments

Comments
 (0)