Skip to content

mafof/miIO_protocol_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miIO protocol controller

This is plugin developed by based on plugin miIO Device Library It's plugin provides simple work above protocol miIO, is provided simple API for send and recieve commands different device's. Have support async methods.

Usage

const miIO = require('miio-controller');

Example

let miio = new miIO("tokenHere", "ipHere");
miio.handshake()
    .then(() => {
        miio.sendCommand('get_prop', ["power"])
            .then(res => console.log(res))
            .catch(err => console.log(err));
    })
    .catch(err => console.log(err));

Example with async await

async function main() {
    let miio = new miIO("tokenHere", "ipHere");
    await miio.handshake();
    console.log(await miio.sendCommand('get_prop', ["power"]));
}
main();

More methods

  • sendJson(json) - send custom json string to device.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published