Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Handlers
Copy Markdown
Open in ChatGPT
Open in Claude
When communicating with the stream, a number of notifications are emitted.
Connect
Emitted on successful connection.
Javascript
x
// Create an instance of Wia// Replace 'd_sk_abcdef' with your device secret keyvar wia = require('wia')('d_sk_abcdef');// Listen for a successful connection to the MQTT APIwia.stream.on('connect', function() { console.log("Connected to the stream!");});Reconnect
Emitted when a reconnect starts.
Javascript
// Create an instance of Wia// Replace 'd_sk_abcdef' with your device secret keyvar wia = require('wia')('d_sk_abcdef');// Listen for a reconnectionwia.stream.on('reconnect', function() { console.log("Reconnect emitted.");});Disconnect
Emitted after a disconnection.
Javascript
// Create an instance of Wia// Replace 'd_sk_abcdef' with your device secret keyvar wia = require('wia')('d_sk_abcdef');// Listen for a disconnectionwia.stream.on('disconnect', function() { console.log("Disconnect emitted.");});Offline
Emitted when the client goes offline.
Javascript
// Create an instance of Wia// Replace 'd_sk_abcdef' with your device secret keyvar wia = require('wia')('d_sk_abcdef');// Listen for an offlinewia.stream.on('offline', function() { console.log("Offline emitted.");});Error
Emitted when a client cannot connect or a parsing error occurs.
Javascript
// Create an instance of Wia// Replace 'd_sk_abcdef' with your device secret keyvar wia = require('wia')('d_sk_abcdef');// Listen for a errorwia.stream.on('error', function(err) { console.log("Error emitted."); console.log(err);});Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Next to read:
Publish an EventDiscard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message
