Skip to content

Busch-Jaeger/node-free-at-home

Repository files navigation

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();