<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
電子發燒友網>電子資料下載>電子資料>用Rust編寫的Homebridge Spotify插件

用Rust編寫的Homebridge Spotify插件

2022-04-21 | zip | 0.01 MB | 次下載 | 免費

資料介紹

授權協議 MIT License
開發語言 JavaScript
操作系統 跨平臺
軟件類型 開源軟件
所屬分類 其他開源、 物聯網

軟件簡介

homebridge-rusty-spotify

Spotify plugin for Homebridge written in Rust. The plugin requires a Spotify Premium account.

Installation and Setup

  1. Install Homebridge: sudo npm install -g homebridge
  2. Install the plugin: sudo npm install -g homebridge-rusty-spotify
  3. Register the plugin as app in the Spotify Developer Dashboard
    1. Login
    2. Select "Create a client ID"
    3. Provide a name and description in the pop-up; click "Next"
    4. Copy the "Client ID" and "Client Secret" which will be required in the following configuration step
    5. Click "Edit Settings"
    6. Add http://localhost/callback as "Redirect URI" and save
  4. 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

  1. Install the Rust toolchain, wasm-pack, cargo-generate and npm by following this guide
  2. Clone the repository
  3. Run make
    • This will create a pkg/ directory containing all the generated nodejs files
  4. Copy the generated files to a device/directory that can be discovered by Homebridge
  5. Switch to the directory and run npm install to install all required dependencies
  6. 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.

?

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數據手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關電源設計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數字電路基礎pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅動電路設計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費
亚洲欧美日韩精品久久_久久精品AⅤ无码中文_日本中文字幕有码在线播放_亚洲视频高清不卡在线观看
<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>