資料介紹
軟件簡介
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-generateandnpmby 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 installto 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傳感器連接成運(yùn)動(dòng)傳感器的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) 557次閱讀
- 如何編寫高性能的Rust代碼 868次閱讀
- Rust的標(biāo)準(zhǔn)庫的功能劃分 1328次閱讀
- Rust語言如何與 InfluxDB 集成 1207次閱讀
- Rust GUI實(shí)踐之Rust-Qt模塊 1629次閱讀
- Rust的 match 語句用法 937次閱讀
- Rust GUI實(shí)踐之Tarui模塊 6165次閱讀
- 基于Rust的Log日志庫介紹 3536次閱讀
- Rust構(gòu)建QEMU插件的框架 934次閱讀
- Rust開源社區(qū)推出龍架構(gòu)原生適配版本 526次閱讀
- 使用C++編寫通用庫并在 Rust 中使用它 (WASI) 1133次閱讀
- Rust的內(nèi)部工作原理 822次閱讀
- 以調(diào)試Rust的方式來學(xué)習(xí)Rust 932次閱讀
- 介紹一種二維碼生成工具 818次閱讀
- 用Rust語言開發(fā)微服務(wù) 2738次閱讀
下載排行
本周
- 1NB-IoT芯片廠商的資料說明
- 0.31 MB | 22次下載 | 1 積分
- 2智慧監(jiān)獄建設(shè)的核心終端—智慧監(jiān)倉屏
- 0.25 MB | 2次下載 | 免費(fèi)
- 3PC318C016M/D 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
- 0.77 MB | 2次下載 | 免費(fèi)
- 45.0SMDJ200A單向TVS瞬態(tài)抑制二極管規(guī)格書
- 0.88 MB | 1次下載 | 免費(fèi)
- 5PC318C041EQ 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
- 0.50 MB | 次下載 | 免費(fèi)
- 6PC318C042NM 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
- 0.55 MB | 次下載 | 免費(fèi)
- 7技嘉H110主板IT8628E_BX IO電路圖資料
- 2.61 MB | 次下載 | 1 積分
- 8H110主板CPU PWM芯片ISL95858HRZ-T核心供電電路圖資料
- 0.63 MB | 次下載 | 1 積分
本月
- 1元宇宙深度解析—未來的未來-風(fēng)口還是泡沫
- 6.40 MB | 241次下載 | 免費(fèi)
- 2元宇宙底層硬件系列報(bào)告
- 13.42 MB | 184次下載 | 免費(fèi)
- 32022 年展望報(bào)告 – 半導(dǎo)體產(chǎn)業(yè)
- 1.43 MB | 136次下載 | 免費(fèi)
- 4晶振與濾波器應(yīng)用電路《電子工程師必備:元器件應(yīng)用寶典》
- 1.57 MB | 90次下載 | 免費(fèi)
- 5汽車電子行業(yè)深度解析:智能化與電動(dòng)化方興未艾
- 6.47 MB | 71次下載 | 免費(fèi)
- 6中國DPU行業(yè)白皮書
- 23.80 MB | 37次下載 | 免費(fèi)
- 7晶科鑫代理線-微盟電子2021年度產(chǎn)品目錄選型手冊
- 14.75 MB | 27次下載 | 免費(fèi)
- 8NB-IoT芯片廠商的資料說明
- 0.31 MB | 22次下載 | 1 積分
總榜
- 1matlab軟件下載入口
- 未知 | 935137次下載 | 10 積分
- 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計(jì)
- 1.48MB | 420064次下載 | 10 積分
- 3Altium DXP2002下載入口
- 未知 | 233089次下載 | 10 積分
- 4電路仿真軟件multisim 10.0免費(fèi)下載
- 340992 | 191425次下載 | 10 積分
- 5十天學(xué)會(huì)AVR單片機(jī)與C語言視頻教程 下載
- 158M | 183352次下載 | 10 積分
- 6labview8.5下載
- 未知 | 81602次下載 | 10 積分
- 7Keil工具M(jìn)DK-Arm免費(fèi)下載
- 0.02 MB | 73822次下載 | 10 積分
- 8LabVIEW 8.6下載
- 未知 | 65991次下載 | 10 積分
電子發(fā)燒友App






創(chuàng)作
發(fā)文章
發(fā)帖
提問
發(fā)資料
發(fā)視頻
上傳資料賺積分
評論