資料介紹
軟件簡介
homebridge-rusty-spotify
Spotify plugin for Homebridge written in Rust. The plugin requires a Spotify Premium account.
Installation and Setup
-
Install Homebridge:
sudo npm install -g homebridge
-
Install the plugin:
sudo npm install -g homebridge-rusty-spotify
- Register the plugin as app in the Spotify Developer Dashboard
- Configure the plugin using the generated client ID and client secret (see Configuration)
Configuration
The generate_config
script can be used to generate the config. It requires for the client_id
, client_secret
and Spotify username
needs to be set since those are required to authenticate to the Spotify Web API. To run the script, make sure to have Python 3 and the spotipy library installed.
Running the script will open a web browser asking to authenticate to Spotify which is required to retrieve the refresh_token
.
$ ./generate_config --help
usage: generate_config [-h] [--client_id CLIENT_ID]
[--client_secret CLIENT_SECRET]
[--redirect_uri REDIRECT_URI] [--username USERNAME]
Script to retrieve an access and refresh token for using the Spotify API
optional arguments:
-h, --help show this help message and exit
--client_id CLIENT_ID, --client-id CLIENT_ID
Spotify client ID
--client_secret CLIENT_SECRET, --client-secret CLIENT_SECRET
Spotify client secret
--redirect_uri REDIRECT_URI, --redirect-uri REDIRECT_URI
Redirect URI
--username USERNAME Spotify username
$ ./generate_config --client_id=<client_id> --client_secret=<client_secret> --username=<username>
{
"platform": "Spotify",
"name": "Spotify",
"service_type": "light", // "light" or "speaker"; Speaker is not supported by HomeKit
"client_id": "" ,
"client_secret": "" ,
"refresh_token": ""
}
The generated config needs to copied to the Homebridge config file (e.g. ~/.homebridge/config.json
). For example:
//...
"platforms": [
{
"platform": "Spotify",
"name": "Spotify",
"service_type": "light", // "light" or "speaker"; Speaker is not supported by HomeKit
"client_id": "" ,
"client_secret": "" ,
"refresh_token": "" ,
}
]
//...
service_type
specifies whether Spotify devices should use the Lightbulb or Speaker service. If service_type
is not specified, "light"
will be used by default. HomeKit currently does not support Speaker services and will show "This accessory is not certified and may not work reliably with HomeKit".
Usage
Add the plugin in the Home app. The plugin will automatically discover available Spotify devices and add them as accessories. Turning a Spotify accessory on will resume playing music on the device, turning off the accessory will pause the music. The accessory also allows to change the playback volume.
Accessories get refreshed every 10 seconds (or as specified in the configuration file).
Development
-
Install the Rust toolchain,
wasm-pack
,cargo-generate
andnpm
by following this guide - Clone the repository
-
Run
make
-
This will create a
pkg/
directory containing all the generated nodejs files
-
This will create a
- Copy the generated files to a device/directory that can be discovered by Homebridge
-
Switch to the directory and run
npm install
to install all required dependencies -
Run Homebridge in debug mode and specify the directory with the plugin files:
DEBUG=* homebridge -D -P /path/to/plugin/homebridge-rusty-spotify
A blog post about writing plugins for Homebridge and specifically this plugin has been published here.
- 用于樹莓派與PIR傳感器連接成運動傳感器的homebridge插件
- Homebridge插件集成Shinobi
- 用于Away的homebridge插件
- Homebridge的Loxone插件
- Homebridge Pi恒溫器插件
- 米家安防攝像頭Homebridge插件
- Homebridge插件可在Apple HomeKit中使用RuuviTags
- homebridge示例插件示例集合
- homebridge-smartthings SmartThings插件
- homebridge miio平臺插件
- 熱門的homebridge插件列表
- 將Wyze連接家庭設(shè)備支持添加到Homebridge的插件
- Homebridge-Denon-Marantz-AVR插件
- Homebridge GPIO WiringPi平臺插件
- Rust 1.15 引入自定義derive特性有什么做用
- 從Rustup出發(fā)看Rust編譯生態(tài) 389次閱讀
- 如何編寫高性能的Rust代碼 672次閱讀
- Rust的標準庫的功能劃分 1104次閱讀
- Rust語言如何與 InfluxDB 集成 941次閱讀
- Rust GUI實踐之Rust-Qt模塊 1356次閱讀
- Rust的 match 語句用法 797次閱讀
- 如何使用Rust連接Redis 1950次閱讀
- 基于Rust的Log日志庫介紹 3121次閱讀
- Rust構(gòu)建QEMU插件的框架 745次閱讀
- Rust開源社區(qū)推出龍架構(gòu)原生適配版本 409次閱讀
- 使用C++編寫通用庫并在 Rust 中使用它 (WASI) 893次閱讀
- Rust的內(nèi)部工作原理 657次閱讀
- 以調(diào)試Rust的方式來學習Rust 805次閱讀
- 介紹一種二維碼生成工具 715次閱讀
- 用Rust語言開發(fā)微服務(wù) 2536次閱讀
下載排行
本周
- 1山景DSP芯片AP8248A2數(shù)據(jù)手冊
- 1.06 MB | 532次下載 | 免費
- 2RK3399完整板原理圖(支持平板,盒子VR)
- 3.28 MB | 339次下載 | 免費
- 3TC358743XBG評估板參考手冊
- 1.36 MB | 330次下載 | 免費
- 4DFM軟件使用教程
- 0.84 MB | 295次下載 | 免費
- 5元宇宙深度解析—未來的未來-風口還是泡沫
- 6.40 MB | 227次下載 | 免費
- 6迪文DGUS開發(fā)指南
- 31.67 MB | 194次下載 | 免費
- 7元宇宙底層硬件系列報告
- 13.42 MB | 182次下載 | 免費
- 8FP5207XR-G1中文應(yīng)用手冊
- 1.09 MB | 178次下載 | 免費
本月
- 1OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234315次下載 | 免費
- 2555集成電路應(yīng)用800例(新編版)
- 0.00 MB | 33566次下載 | 免費
- 3接口電路圖大全
- 未知 | 30323次下載 | 免費
- 4開關(guān)電源設(shè)計實例指南
- 未知 | 21549次下載 | 免費
- 5電氣工程師手冊免費下載(新編第二版pdf電子書)
- 0.00 MB | 15349次下載 | 免費
- 6數(shù)字電路基礎(chǔ)pdf(下載)
- 未知 | 13750次下載 | 免費
- 7電子制作實例集錦 下載
- 未知 | 8113次下載 | 免費
- 8《LED驅(qū)動電路設(shè)計》 溫德爾著
- 0.00 MB | 6656次下載 | 免費
總榜
- 1matlab軟件下載入口
- 未知 | 935054次下載 | 免費
- 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
- 78.1 MB | 537798次下載 | 免費
- 3MATLAB 7.1 下載 (含軟件介紹)
- 未知 | 420027次下載 | 免費
- 4OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234315次下載 | 免費
- 5Altium DXP2002下載入口
- 未知 | 233046次下載 | 免費
- 6電路仿真軟件multisim 10.0免費下載
- 340992 | 191187次下載 | 免費
- 7十天學會AVR單片機與C語言視頻教程 下載
- 158M | 183279次下載 | 免費
- 8proe5.0野火版下載(中文版免費下載)
- 未知 | 138040次下載 | 免費
評論
查看更多