• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

StefanNienhuis/homebridge-programmable-http-switch: A Homebridge plugin that all ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

StefanNienhuis/homebridge-programmable-http-switch

开源软件地址:

https://github.com/StefanNienhuis/homebridge-programmable-http-switch

开源编程语言:

TypeScript 100.0%

开源软件介绍:

Programmable HTTP Switch

verified-by-homebridge Downloads Version
Issues Pull requests

This Homebridge plugin allows users to create Stateless Programmable Switches which can be controlled using a HTTP API.

Installation

First, install Homebridge
npm install --global homebridge

Then, install the Programmable HTTP Switch plugin
npm install --global homebridge-programmable-http-switch

Configuration

Platform configuration

An example configuration can be found in the config.example.json file.

Property Type Details
platform string Required
Must always be ProgrammableHTTPSwitch.
accessories Accessory[] Required
List of accessory configurations.
port number Optional, default: 3000
The port that the HTTP server should listen on.

Accessory configuration

Property Type Details
name string Required
The name of the accessory.
identifier string Required
The identifier used in the API.
buttons Button[] Required
List of button configurations.

Button configuration

Property Type Details
name string Required
The name of the button.
Note: Not shown in Apple's Home app.
identifier string Required
The identifier used in the API.
supportedActions string[] Optional, default: all
List of actions that this button supports.
Supported values: singlePress (0), doublePress (1) and longPress (2)

API endpoints

GET /accessories

Description
Returns all the currently configured accessoires.

GET /accessories/:accessoryIdentifier

Description
Returns an accessory with a specific identifier.

GET /accessories/:accessoryIdentifier/buttons

Description
Returns all buttons for an accessory with a specific identifier.

GET /accessories/:accessoryIdentifier/buttons/:buttonIdentifier

Description
Returns a button with a specific identifier for an accessory with a specific identifier.

PUT /accessories/:accessoryIdentifier/buttons/:buttonIdentifier

Description
Sets the state of a specific button on a specific accessory.

Body

{
    "action": "singlePress"
}

Note: Action must be one of the supported actions configured for the specific button.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap