homebridge-framework
This framework provides an easy-to-use wrapper for the homebridge API. It aims to only provide the features that are actually needed to develop a plugin. The framework is written in TypeScript and it is recommended to also develop the plugins with this framework in TypeScript. Besides the stripped-down API that this framework provides, it automatically manages accessories, services and characteristics. There is no need to explicitely remove those entities from homebridge. If an accessory/service/characteristic is not "used" at runtime, it is removed from homebridge.
Features
- Declarative syntax
- Automatic registration/deregistration of accessories
- Automatic adding/removing of services
- Automatic adding/removing of characteristics
- Typed configuration
Getting Started
Create a new project and add the framework (homebridge-framework
) as a devDependency
to the NPM package.json
file.
Configuration
Create a new interface for your configuration. This will be used to access the configuration strongly typed.
Platform
In order to use the framework, create a new class that inherits from HomebridgePlatform
:
;;
Index file
In order to load the correct platform instance, your main plugin file should look like this:
;; module.exports = Homebridge.registernew MyPlatform;