1.0.2 • Published 5 years ago
homebridge-light-http v1.0.2
homebridge-light-http
Installation
- Install homebridge, running
npm install -g homebrige
- Install homebridge-light-http, running
npm install -g homebridge-light-http
- Update your
config.json
file in~/.homebridge/config.json
Configuration
You can specify following fields:
- name - it will be displayed in Home App on your iOS device
- pin - integer that will be used to set and get state
- url - url for requests
- debug - used for logging output to console
Sample
API
Your API need to handle following 2 endpoints:
/
with GET method for getting current state. Pin will be passed in URL aspin
. The API must return1
when the light is on, and0
when it's off./
with POST method for setting state. In body there will be passed 2 variables:pin
andaction
. The action will be eitherTURN_ON
orTURN_OFF
You can find API example here