electra-smart-js-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Electra Smart JS client

Port of yonatanp/electrasmart in JS

Usage

Get the authentication data

npm i -g electra-smart-js-client

electra-smart-js-client
# This will log { "imei": "<imei>", "token": "<token>" }
# Save it for later use

Use it from Node.js code

import { Client } from 'electra-smart-js-client';

async function run() {
  const client = await new Client({
    imei: '<imei>', // This is the imei value from the previous step
    token: '<token>', // This is the token value from the previous step
  });

  const devices = await client.getDevices();

  // Choose the device you want to control
  const deviceId = devices[0].id;

  // Control it 🔥
  await client.setMode(deviceId, 'HEAT');
}

run().then(console.log).catch(console.error);

Package Sidebar

Install

npm i electra-smart-js-client

Weekly Downloads

16

Version

1.0.1

License

MIT

Unpacked Size

50.5 kB

Total Files

40

Last publish

Collaborators

  • rluvaton