hapkit
v0.0.2
Published
An Apple HomeKit Accessory Protocol kit and server for easily wrapping your accessories in NodeJS for both Type- and JavaScript. 📡🏚
Downloads
3
Readme
Hard Work In Progress
It will look something like
import { Bridge, Light, Switch } from "hapkit";
export default class Service extends Bridge {
private kitchenLight: Light({
uid: 1,
name: "Kitchen",
actions: { // ILightActions
on: "http://192.0.0.2/kitchen/on", // IAction URL or function
off: "http://192.0.0.2/kitchen/off"
}
});
private waterCooker: Switch({
uid: 2,
name: "Water Cooker",
actions: {
on: "http://192.0.0.2/cooker/on",
off: "http://192.0.0.2/cooker/off"
}
)};
constructor() {
super(
this.kitchenLight,
this.waterCooker
);
}
}
Thats all, now your light will show up in HomeKit. You can even toggle it using your own api!
http://192.0.0.1:92000/accessories
[
{
"uid": 1,
"name": "Kitchen",
"type": "light",
"url": "http://192.0.0.1:92000/accessories/1",
"actions": [
{
"name": "on",
"description": "Powers the light on",
"url": "http://192.0.0.1:92000/accessories/1/on"
},{
"name": "off",
"description": "Powers the light off",
"url": "http://192.0.0.1:92000/accessories/1/off"
}
]
}
...
]