Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit dabff51

Browse files
committed
Derive clean session property from client id and QoS level
1 parent c005fb9 commit dabff51

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

api/remote/remote.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func (r *Remote) Run(ctx context.Context) error {
3535
if r.Password != "" {
3636
opts.SetPassword(r.Password)
3737
}
38+
opts.SetCleanSession(r.ClientID == "" || r.QoS == 0)
3839

3940
opts.OnConnect = func(c mqtt.Client) {
4041
log.Println("MQTT connected")

0 commit comments

Comments
 (0)