Skip to content

Commit 405a7d7

Browse files
committed
use mqtt connection options
1 parent ebf3279 commit 405a7d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/mqtt.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export async function startAdafruitIOMQTTClient(options?: UserOptions) {
1818
host: "io.adafruit.com",
1919
port: 8883,
2020
})
21-
;(client as any).__user = user
2221
return client
2322
}
2423

@@ -33,7 +32,7 @@ export async function publishData(
3332
options?: FeedOptions
3433
) {
3534
const { feed, lon, lat, ele } = await loadFeedOptions(options)
36-
const user = (client as any).__user as string
35+
const user = client.opt.username
3736
const topic = `${user}/f/${feed}/json`
3837
const payload: any = { value }
3938
if (lon !== undefined) payload.lon = lon

0 commit comments

Comments
 (0)