Skip to content

Commit 48d29f2

Browse files
Danielius1922Daniel Adam
authored andcommitted
client: propagate deviceID option to FactoryReset call
1 parent 1107a03 commit 48d29f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/disownDevice.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ func (c *Client) DisownDevice(ctx context.Context, deviceID string, opts ...Comm
4242
}
4343
defer c.removeTemporaryDeviceFromCache(ctx, d)
4444

45+
if c.useDeviceIDInQuery {
46+
cfg.opts = append(cfg.opts, coap.WithDeviceID(deviceID))
47+
}
48+
4549
ok := d.IsSecured()
4650
if !ok {
4751
return d.FactoryReset(ctx, links, cfg.opts...)
4852
}
4953

50-
if c.useDeviceIDInQuery {
51-
cfg.opts = append(cfg.opts, coap.WithDeviceID(deviceID))
52-
}
53-
5454
return d.Disown(ctx, links, cfg.opts...)
5555
}

0 commit comments

Comments
 (0)