[Documentation] Markdown improvements n to s (#13948)
Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
This commit is contained in:
committed by
GitHub
parent
d73218d882
commit
1ca9baf157
@@ -47,19 +47,18 @@ You can force reinitialization by authorizing on the connect Spotify page, even
|
||||
|
||||
The following configuration options are available on the Spotify Bridge player:
|
||||
|
||||
| Parameter | Description |
|
||||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| clientId | This is the Client ID provided by Spotify when you add a new Application for openHAB to your Spotify Account. Go to https://developer.spotify.com/ (Required) |
|
||||
| clientSecret | This is the Client Secret provided by Spotify when you add a new Application for openHAB to your Spotify Account. (Required) |
|
||||
| refreshPeriod | This is the frequency of the polling requests to the Spotify Connect Web API in seconds. |
|
||||
| Parameter | Description |
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| clientId | This is the Client ID provided by Spotify when you add a new Application for openHAB to your Spotify Account. Go to <https://developer.spotify.com/> (Required) |
|
||||
| clientSecret | This is the Client Secret provided by Spotify when you add a new Application for openHAB to your Spotify Account. (Required) |
|
||||
| refreshPeriod | This is the frequency of the polling requests to the Spotify Connect Web API in seconds. |
|
||||
|
||||
The following configuration option is available on the Spotify device:
|
||||
|
||||
| Parameter | Description |
|
||||
|------------|---------------------------------------------------------|
|
||||
| ---------- | ------------------------------------------------------- |
|
||||
| deviceName | This is the device name provided by Spotify (Required). |
|
||||
|
||||
|
||||
## Supported Things
|
||||
|
||||
All Spotify Connect capable devices should be discoverable through this binding.
|
||||
@@ -88,49 +87,49 @@ It only knows about a device if your account is currently associated with the de
|
||||
|
||||
The channels on the bridge are the ones used to both control the active device and get details of currently playing music on the Spotify Account associated with the bridge.
|
||||
|
||||
__Common Channels:__
|
||||
**Common Channels:**
|
||||
|
||||
| Channel Type ID | Item Type | Read/Write | Description |
|
||||
|-----------------|-----------|------------|--------------------------------------------------------------------------------------------------|
|
||||
| deviceName | String | Read-write | Name of the currently active Connect Device, |
|
||||
| devices | Selection | Read-write | List of currently active Connect Devices, Set the device ID to transfer play to that device. |
|
||||
| deviceVolume | Dimmer | Read-write | Get or set the active Connect Device volume. |
|
||||
| deviceShuffle | Switch | Read-write | Turn on/off shuffle play on the active device. |
|
||||
| trackPlay | String | Read-write | Set which music to play on the active device. This channel accepts Spotify URIs and URLs. |
|
||||
| trackPlayer | Player | Read-write | The Player Control of the active device. Accepts PLAY/PAUSE/NEXT/PREVIOUS commands. |
|
||||
| trackRepeat | String | Read-only | `track` repeats the current track. `context` repeats the current context. `off` turns repeat off.|
|
||||
| trackName | String | Read-only | The name of the currently playing track. |
|
||||
| trackDuration | String | Read-only | The duration (m:ss) of the currently playing track. This is updated every second. |
|
||||
| trackDurationMs | Number | Read-only | The duration of the currently playing track in milliseconds. |
|
||||
| trackProgress | String | Read-only | The progress (m:ss) of the currently playing track. This is updated every second. |
|
||||
| trackProgressMs | Number | Read-only | The progress of the currently playing track in milliseconds. |
|
||||
| playlists | Selection | Read-write | This channel will be populated with the users playlists. Set the playlist ID to start. |
|
||||
| playlistName | String | Read-write | The currently playing playlist. Or empty if no playing list is playing. |
|
||||
| albumName | String | Read-only | Album Name of the currently playing track. |
|
||||
| albumImage | RawType | Read-only | Album Image of the currently playing track. |
|
||||
| albumImageUrl | String | Read-only | Url to the album Image of the currently playing track. |
|
||||
| artistName | String | Read-only | Artist Name of the currently playing track. |
|
||||
| Channel Type ID | Item Type | Read/Write | Description |
|
||||
| --------------- | --------- | ---------- | ------------------------------------------------------------------------------------------------- |
|
||||
| deviceName | String | Read-write | Name of the currently active Connect Device, |
|
||||
| devices | Selection | Read-write | List of currently active Connect Devices, Set the device ID to transfer play to that device. |
|
||||
| deviceVolume | Dimmer | Read-write | Get or set the active Connect Device volume. |
|
||||
| deviceShuffle | Switch | Read-write | Turn on/off shuffle play on the active device. |
|
||||
| trackPlay | String | Read-write | Set which music to play on the active device. This channel accepts Spotify URIs and URLs. |
|
||||
| trackPlayer | Player | Read-write | The Player Control of the active device. Accepts PLAY/PAUSE/NEXT/PREVIOUS commands. |
|
||||
| trackRepeat | String | Read-only | `track` repeats the current track. `context` repeats the current context. `off` turns repeat off. |
|
||||
| trackName | String | Read-only | The name of the currently playing track. |
|
||||
| trackDuration | String | Read-only | The duration (m:ss) of the currently playing track. This is updated every second. |
|
||||
| trackDurationMs | Number | Read-only | The duration of the currently playing track in milliseconds. |
|
||||
| trackProgress | String | Read-only | The progress (m:ss) of the currently playing track. This is updated every second. |
|
||||
| trackProgressMs | Number | Read-only | The progress of the currently playing track in milliseconds. |
|
||||
| playlists | Selection | Read-write | This channel will be populated with the users playlists. Set the playlist ID to start. |
|
||||
| playlistName | String | Read-write | The currently playing playlist. Or empty if no playing list is playing. |
|
||||
| albumName | String | Read-only | Album Name of the currently playing track. |
|
||||
| albumImage | RawType | Read-only | Album Image of the currently playing track. |
|
||||
| albumImageUrl | String | Read-only | Url to the album Image of the currently playing track. |
|
||||
| artistName | String | Read-only | Artist Name of the currently playing track. |
|
||||
|
||||
The `playlists` channel has 2 parameters:
|
||||
|
||||
| Parameter | Description |
|
||||
|-----------|----------------------------------------------------------------------------|
|
||||
| --------- | -------------------------------------------------------------------------- |
|
||||
| offset | The index of the first playlist to return. Default `0`, max `100.000` |
|
||||
| limit | The maximum number of playlists to return. Default `20`, min `1`, max `50` |
|
||||
|
||||
The `albumImage` and `albumImageUrl` channels has 1 parameter:
|
||||
|
||||
| Parameter | Description |
|
||||
|------------|--------------------------------------------------------------------------------------------|
|
||||
| ---------- | ------------------------------------------------------------------------------------------ |
|
||||
| imageIndex | Index in list of to select size of the image to show. 0:large (default), 1:medium, 2:small |
|
||||
|
||||
Note: The `deviceName` and `playlist` channels are Selection channels.
|
||||
They are dynamically populated by the binding with the user specific devices and playlists.
|
||||
|
||||
__Advanced Channels:__
|
||||
**Advanced Channels:**
|
||||
|
||||
| Channel Type ID | Item Type | Read/Write | Description |
|
||||
|-----------------|-----------|------------|-------------------------------------------------------------|
|
||||
| --------------- | --------- | ---------- | ----------------------------------------------------------- |
|
||||
| accessToken | String | Read-only | The current accessToken used in communication with Web API. |
|
||||
| deviceId | String | Read-write | The Spotify Connect device Id. |
|
||||
| trackId | String | Read-only | Track Id of the currently playing track. |
|
||||
@@ -157,20 +156,20 @@ The difference between these overlapping channels are that the device channels a
|
||||
E.g. if you assign a playlist to the _trackPlay_ channel of the device, the playing of that playlist will be activated on that particular device.
|
||||
Assigning a playlist to the _trackPlay_ channel of the bridge will start playing the list on whatever device is active.
|
||||
|
||||
__Common Channels:__
|
||||
**Common Channels:**
|
||||
|
||||
| Channel Type ID | Item Type | Read/Write | Description |
|
||||
|-----------------|-----------|------------|-----------------------------------------------------------------|
|
||||
| --------------- | --------- | ---------- | --------------------------------------------------------------- |
|
||||
| trackPlay | String | Write-only | Update to play a track, playlist, artist. Activates the device. |
|
||||
| deviceName | String | Read-only | Name of the device. |
|
||||
| deviceVolume | Dimmer | Read-write | Volume setting for the device. |
|
||||
| devicePlayer | Player | Read-write | Player Control of the device. |
|
||||
| deviceShuffle | Switch | Read-write | Turn on/off shuffle play. |
|
||||
|
||||
__Advanced Channels:__
|
||||
**Advanced Channels:**
|
||||
|
||||
| Channel Type ID | Item Type | Read/Write | Description |
|
||||
|------------------|-----------|------------|------------------------------------------------------------------------------------------------------------|
|
||||
| ---------------- | --------- | ---------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| deviceId | String | Read-write | The Spotify Connect device Id. |
|
||||
| deviceType | String | Read-only | The type of device e.g. Speaker, Smartphone. |
|
||||
| deviceActive | Switch | Read-only | Indicates if the device is active or not. Should be the same as Thing status ONLINE/OFFLINE. |
|
||||
@@ -181,21 +180,20 @@ __Advanced Channels:__
|
||||
The bridge supports an action to play a track or other context uri.
|
||||
The following actions are supported:
|
||||
|
||||
```
|
||||
```java
|
||||
play(String context_uri)
|
||||
play(String context_uri, int offset, int position_ms)
|
||||
play(String context_uri, String device_id)
|
||||
play(String context_uri, String device_id, int offset, int position_ms)
|
||||
```
|
||||
|
||||
|
||||
## Full Example
|
||||
|
||||
In this example there is a bridge configured with Thing ID __user1__ and illustrating that the bridge is authorized to play in the context of the Spotify user account __user1__.
|
||||
In this example there is a bridge configured with Thing ID **user1** and illustrating that the bridge is authorized to play in the context of the Spotify user account **user1**.
|
||||
|
||||
spotify.things:
|
||||
|
||||
```
|
||||
```java
|
||||
Bridge spotify:player:user1 "Me" [clientId="<your client id>", clientSecret="<your client secret>"] {
|
||||
Things:
|
||||
device device1 "Device 1" [deviceName="<spotify device name>"]
|
||||
@@ -208,7 +206,7 @@ Bridge spotify:player:user1 "Me" [clientId="<your client id>", clientSecret="<yo
|
||||
|
||||
spotify.items:
|
||||
|
||||
```
|
||||
```java
|
||||
Player spotifyTrackPlayer "Player" {channel="spotify:player:user1:trackPlayer"}
|
||||
String spotifyDevices "Active device [%s]" {channel="spotify:player:user1:devices"}
|
||||
Switch spotifyDeviceShuffle "Shuffle mode" {channel="spotify:player:user1:deviceShuffle"}
|
||||
@@ -235,7 +233,7 @@ Switch device2DeviceShuffle {channel="spotify:device:user1:device2:deviceShuffle
|
||||
|
||||
spotify.sitemap:
|
||||
|
||||
```
|
||||
```perl
|
||||
sitemap spotify label="Spotify Sitemap" {
|
||||
|
||||
Frame label="Spotify Player Info" {
|
||||
@@ -270,7 +268,7 @@ sitemap spotify label="Spotify Sitemap" {
|
||||
|
||||
spotify.rules
|
||||
|
||||
```
|
||||
```java
|
||||
val spotifyActions = getActions("spotify", "spotify:player:user1")
|
||||
// play the song
|
||||
spotifyActions.play("spotify:track:4cOdK2wGLETKBW3PvgPWqT")
|
||||
|
||||
Reference in New Issue
Block a user