chinese直男口爆体育生外卖, 99久久er热在这里只有精品99, 又色又爽又黄18禁美女裸身无遮挡, gogogo高清免费观看日本电视,私密按摩师高清版在线,人妻视频毛茸茸,91论坛 兴趣闲谈,欧美 亚洲 精品 8区,国产精品久久久久精品免费

電子發(fā)燒友App

硬聲App

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>用Rust編寫的Homebridge Spotify插件

用Rust編寫的Homebridge Spotify插件

2022-04-21 | zip | 0.01 MB | 次下載 | 免費(fèi)

資料介紹

授權(quán)協(xié)議 MIT License
開發(fā)語言 JavaScript
軟件類型 開源軟件
所屬分類 其他開源、 物聯(lián)網(wǎng)

軟件簡介

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. 1NB-IoT芯片廠商的資料說明
  2. 0.31 MB   |  22次下載  |  1 積分
  3. 2智慧監(jiān)獄建設(shè)的核心終端—智慧監(jiān)倉屏
  4. 0.25 MB   |  2次下載  |  免費(fèi)
  5. 3PC318C016M/D 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
  6. 0.77 MB   |  2次下載  |  免費(fèi)
  7. 45.0SMDJ200A單向TVS瞬態(tài)抑制二極管規(guī)格書
  8. 0.88 MB   |  1次下載  |  免費(fèi)
  9. 5PC318C041EQ 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
  10. 0.50 MB   |  次下載  |  免費(fèi)
  11. 6PC318C042NM 200V半橋柵極驅(qū)動(dòng)器技術(shù)手冊
  12. 0.55 MB   |  次下載  |  免費(fèi)
  13. 7技嘉H110主板IT8628E_BX IO電路圖資料
  14. 2.61 MB   |  次下載  |  1 積分
  15. 8H110主板CPU PWM芯片ISL95858HRZ-T核心供電電路圖資料
  16. 0.63 MB   |  次下載  |  1 積分

本月

  1. 1元宇宙深度解析—未來的未來-風(fēng)口還是泡沫
  2. 6.40 MB  |  241次下載  |  免費(fèi)
  3. 2元宇宙底層硬件系列報(bào)告
  4. 13.42 MB  |  184次下載  |  免費(fèi)
  5. 32022 年展望報(bào)告 – 半導(dǎo)體產(chǎn)業(yè)
  6. 1.43 MB  |  136次下載  |  免費(fèi)
  7. 4晶振與濾波器應(yīng)用電路《電子工程師必備:元器件應(yīng)用寶典》
  8. 1.57 MB  |  90次下載  |  免費(fèi)
  9. 5汽車電子行業(yè)深度解析:智能化與電動(dòng)化方興未艾
  10. 6.47 MB  |  71次下載  |  免費(fèi)
  11. 6中國DPU行業(yè)白皮書
  12. 23.80 MB  |  37次下載  |  免費(fèi)
  13. 7晶科鑫代理線-微盟電子2021年度產(chǎn)品目錄選型手冊
  14. 14.75 MB  |  27次下載  |  免費(fèi)
  15. 8NB-IoT芯片廠商的資料說明
  16. 0.31 MB   |  22次下載  |  1 積分

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935137次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計(jì)
  4. 1.48MB  |  420064次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233089次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費(fèi)下載
  8. 340992  |  191425次下載  |  10 積分
  9. 5十天學(xué)會(huì)AVR單片機(jī)與C語言視頻教程 下載
  10. 158M  |  183352次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81602次下載  |  10 積分
  13. 7Keil工具M(jìn)DK-Arm免費(fèi)下載
  14. 0.02 MB  |  73822次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65991次下載  |  10 積分