New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapkit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapkit

An Apple HomeKit Accessory Protocol kit and server for easily wrapping your accessories in NodeJS for both Type- and JavaScript. 📡🏚

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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"
      }
    ]
  }
  ...
]

FAQs

Package last updated on 19 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc