在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:scholtzan/homebridge-rusty-spotify开源软件地址:https://github.com/scholtzan/homebridge-rusty-spotify开源编程语言:Rust 93.0%开源软件介绍:homebridge-rusty-spotifySpotify plugin for Homebridge written in Rust. The plugin requires a Spotify Premium account. Installation and Setup
ConfigurationThe Running the script will open a web browser asking to authenticate to Spotify which is required to retrieve the $ ./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_id>",
"client_secret": "<client_secret>",
"refresh_token": "<refresh_token>"
} The generated config needs to copied to the Homebridge config file (e.g. //...
"platforms": [
{
"platform": "Spotify",
"name": "Spotify",
"service_type": "light", // "light" or "speaker"; Speaker is not supported by HomeKit
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"refresh_token": "<refresh_token>",
}
]
//...
UsageAdd 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
A blog post about writing plugins for Homebridge and specifically this plugin has been published here. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论