Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 2.04 KB

File metadata and controls

41 lines (27 loc) · 2.04 KB

Docs

Table of Contents

TuyaDevice

Represents a Tuya device.

Parameters

  • options Object options for constructing a TuyaDevice
    • options.type string type of device (optional, default 'outlet')
    • options.ip string IP of device
    • options.port number port of device (optional, default 6668)
    • options.id string ID of device
    • options.uid string UID of device
    • options.key string encryption key of device
    • options.version number protocol version (optional, default 3.1)

getStatus

Gets the device's current status.

Parameters

  • callback function (error, result)

setStatus

Sets the device's status.

Parameters

  • on boolean true for on, false for off
  • callback function (error, result) returns true if the command succeeded