TuyaStub

A stub implementation of the Tuya protocol for local testing.

new TuyaStub(options: Object)
Parameters
options (Object)
Name Description
options.state Object (default {}) inital state of device
options.id String ID of mock device
options.key String key of mock device
options.ip String (default localhost) IP address of mock device
options.respondToHeartbeat Boolean (default true) sends pong if true in response to pings
Example
const stub = new TuyaStub({ id: 'xxxxxxxxxxxxxxxxxxxx',
key: 'xxxxxxxxxxxxxxxx',
state: {'1': false, '2': true}});
Instance Members
â–¸ startServer(port)
â–¸ shutdown()
â–¸ startUDPBroadcast(options)
â–¸ setProperty(property, value)
â–¸ getProperty(property)
â–¸ getState()
â–¸ setState(state)