Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 888 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 888 Bytes

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