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.
// Create an instance of Wia
// Replace 'd_sk_abcdef' with your device secret key
var wia = require('wia')('d_sk_abcdef');
// Listen for a successful connection to the MQTT API
wia.stream.on('connect', function() {
console.log("Connected to the stream!");
});
Reconnect
Emitted when a reconnect starts.
// Create an instance of Wia
// Replace 'd_sk_abcdef' with your device secret key
var wia = require('wia')('d_sk_abcdef');
// Listen for a reconnection
wia.stream.on('reconnect', function() {
console.log("Reconnect emitted.");
});
Disconnect
Emitted after a disconnection.
// Create an instance of Wia
// Replace 'd_sk_abcdef' with your device secret key
var wia = require('wia')('d_sk_abcdef');
// Listen for a disconnection
wia.stream.on('disconnect', function() {
console.log("Disconnect emitted.");
});
Offline
Emitted when the client goes offline.
// Create an instance of Wia
// Replace 'd_sk_abcdef' with your device secret key
var wia = require('wia')('d_sk_abcdef');
// Listen for an offline
wia.stream.on('offline', function() {
console.log("Offline emitted.");
});
Error
Emitted when a client cannot connect or a parsing error occurs.
// Create an instance of Wia
// Replace 'd_sk_abcdef' with your device secret key
var wia = require('wia')('d_sk_abcdef');
// Listen for a error
wia.stream.on('error', function(err) {
console.log("Error emitted.");
console.log(err);
});
Last updated on
Next to read:
Publish an Eventnull
Discard 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
