0.31.1 • Published 1 year ago

@christoph-kronberger/free-at-home v0.31.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Library for free@home local device api

This api is unstable.

Install

Npm packages for this project are available here.

To install this packages run:

npm install @busch-jaeger/free-at-home

Documentation

The Documentation of this project is available here.

Example

import { FreeAtHome } from '@busch-jaeger/free-at-home';

const freeAtHome = new FreeAtHome();
freeAtHome.activateSignalHandling();

async function main() {
  const virtualSwitch = await freeAtHome.createSwitchingActuatorDevice("123switch", "Virtual Switch");
  virtualSwitch.setAutoKeepAlive(true);
  virtualSwitch.setAutoConfirm(true);
  virtualSwitch.on('isOnChanged', (value) => {
    console.log("switch state is:", (value) ? "on" : "off");
  });
}

main();