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

JosephDuffy/homebridge-pc-volume: Homebridge plugin to control your computer&#39 ...

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

开源软件名称:

JosephDuffy/homebridge-pc-volume

开源软件地址:

https://github.com/JosephDuffy/homebridge-pc-volume

开源编程语言:

TypeScript 93.3%

开源软件介绍:

homebridge-pc-volume

Verified by Homebridge Tests Status codecov npm version

homebridge-pc-volume is a Homebridge plugin that adds a support for changing a computer's volume using HomeKit and Siri.

OS Support

homebridge-pc-volume utilises node-loudness, which currently supports macOS, Linux (using ALSA), and Windows. Windows may need OpenSSL to be installed; it is required when being run on CI, which installs the latest 64-bit not-light 1.0.2 build avialable from https://slproweb.com/products/Win32OpenSSL.html. I have not personally tested this project on Linux or Windows.

Installation

First, install Homebridge.

Then install homebridge-pc-volume via npm:

npm install -g homebridge-pc-volume

homebridge-pc-volume will also need to be specified as an accessory in your ~/.homebridge/config.json:

{
  // Other keys here...
  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook"
    }
  ]
}

Note that accessory must be "ComputerSpeakers", while the name can be any value of your choosing.

Configuration

When the property logarithmic is set to true the volume will be scaled logarithmically.

The services property can be used to decide how your computer's speaker will be exposed: as a lightbulb, fan, speaker, or a combination of all 3.

Please note that while iOS 11 supports "HomeKit speakers" this appears to actually be via AirPlay 2, so the "speaker" option is unlikely to work!

If no services key is provided a lightbulb will be exposed.

Lightbulb Only (default, implicit)

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook"
    }
  ]

Lightbulb Only (default prior to 1.1)

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook",
      "services": ["lightbulb"]
    }
  ]

Fan Only

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook",
      "services": ["fan"]
    }
  ]

Speaker and Fan

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook",
      "services": ["speaker", "fan"]
    }
  ]

Volume Buttons

Buttons can be exposed that will increase or decrease the system volume by a set percentage. These services are called increase-button and decrease-button. switchVolumeDelta can be provided to change the default percentage change of 5%. switchDelay controls the delay in ms between the switch being turned on and turned back off. Without a delay the Home app will not display the change. Defaults to 10.

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook",
      "services": ["fan", "increase-button", "decrease-button"],
      "switchVolumeDelta": 10,
      "switchDelay": 100
    }
  ]

Initial Values

If you wish to set some initial values when the plugin starts you can set the initialVolume and initiallyMuted properties:

  "accessories": [
    {
      "accessory": "ComputerSpeakers",
      "name": "MacBook",
      "initialVolume": 70,
      "initiallyMuted": true
    }
  ]

Development

To develop homebridge-pc-volume locally:

  1. Clone the project
  2. Run npm install
  3. Run npm run build
  4. Run npm install --global $(pwd)

This will allow homebridge to find your local version of homebridge-pc-volume. After making changes you will need to restart homebridge.

You may also stop any homebridge instance you already have running and run yarn build:watch:debug, which will start homebridge, and automatically restart it when a source file is updated. This instance of homebridge uses the .homebridge-debug/config.json config file.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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