Coder Social home page Coder Social logo

homebridge-examples's Introduction

homebridge-examples

This repo bundles some example implementations for homebridge plugins. They provide some example code to get started with. They are also published on npm like regular plugins, so you can easily run them in your local homebridge instance. Refer to the respective package.json for the plugin name and install them as usual.

The examples are all written in Typescript and thus require at least homebridge v1.0.0.
To build a plugin run the following commands in the respective plugin directory.

Run this command once to install all dependencies required by the plugin:

npm install

After that run the following command to compile the Typescript files into Javascript (repeat this step every time you change something in the code).

npm run build

If you need inspiration for a plugin written in Javascript you can just run the above commands and look at the generated Javascript code located in the ./dist folder. You may need to ignore some code at the beginning of the file generated by the Typescript compiler.

Examples for different homebridge plugin types

Accessory Plugins

Accessory plugins are the most basic and simplest plugins for homebridge. They should be used if you only want to expose a single accessory and don't require any special functionality.

Platform Plugins:

Platform plugins are able to expose multiple accessories. Additionally, they are required if you want to use the Controller API.

  • Static Platform Plugin: Static platforms know which accessories they want to expose on start up. The set of accessories cannot change over the lifespan of the plugin.
  • Dynamic Platform Plugin: Dynamic platforms can dynamically add or remove accessories at runtime. Accessories are fully stored to disk by homebridge, and the exact state is reconstructed on a reboot. The plugin can store additional context as well.
  • Independent Platform Plugin: Independent platforms are typically used when the platform intends to only expose external accessories or provides other functionality while not exposing an accessory at all.

Other example plugins

homebridge-examples's People

Contributors

supereg avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.