@shortfuse/samsungrac

0.0.6 • Public • Published

samsungrac

NodeJS library for controlling Samsung RAC devices.

Usage (CLI)

node cli [OPTION]...

See cli/index.js for options.

Usage (NodeJS)

import MIMH03Device from '@shortfuse/samsungrac/mim-h03.js';

async function getToken(ip) {
  const controller = new MIMH03Device({ ip });
  const token = await controller.requestToken();
  console.log('Token:', token);
  return token;
}

async function updateDevice(ip, token) {
  const controller = new MIMH03Device({ ip, token });
  const { Devices } = await controller.getDevices();
  const target = Devices[0];
  await controller.setMode(target, 'Opmode_Cool');
  await controller.setTemperature(target, 70);
  await controller.setFanSpeed(target, 0);
  await controller.setFanDirection(target, 'Fix');
});

Package Sidebar

Install

npm i @shortfuse/samsungrac

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

29.3 kB

Total Files

18

Last publish

Collaborators

  • shortfuse