flic-client
v0.0.5
Published
Typescript based, promise compatible client for the Flic Linux service
Downloads
4
Readme
flic-client
Client library for the Flic linux daemon, ported to Typescript and Promises from the official one
Why?
Because the original one is lacking types, and uses callbacks, and I don't like that 👎
Requirements
Uses Typescript compilation target ES2017, so requires NodeJS >= 8.10.
Usage
import { FlicClient } from "./client";
var client = new FlicClient("192.168.1.23", 5551);
// Start connects to the service and connects to all buttons
await client.start();
client.on("ButtonSingleClick", console.log);
client.on("ButtonDoubleClick", console.log);
client.on("ButtonHold", console.log);
client.on("ButtonUp", console.log);
client.on("ButtonDown", console.log);
client.on("ButtonClick", console.log);
client.on("ButtonStatusChanged", console.log);
client.on("ButtonBatteryPercentage", console.log);