From 6f5e2338488c9842b71412b1b1094fdab02d5a8b Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:04:47 +0100 Subject: [PATCH 1/7] docs: Some bad links in readme --- README.md | 3 +-- generator/sonos-docs/data/sonos-S1-2.json | 29 ++-------------------- generator/sonos-docs/data/sonos-S18-2.json | 29 ++-------------------- generator/sonos-docs/data/sonos-S33-2.json | 29 ++-------------------- generator/sonos-docs/data/sonos-S5-1.json | 4 +-- generator/sonos-docs/data/sonos-S9-2.json | 29 ++-------------------- 6 files changed, 11 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index d803686..5f1bbfd 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Check-out the (generated) documentation about all the SONOS UPNP services [svroo ### Manually documented -The [sonos services](https://svrooij.io/sonos-api-docs/services/) have no documentation, that is why we manually created a [documentation.json](http://svrooij.io/sonos-api-docs/documentation.json) file. To easily add documentation to all services (that are generated with the generator). And it's json so you can easily use it yourself. +The [sonos services](https://sonos.svrooij.io/services/) have no documentation, that is why we manually created a [documentation.json](https://github.com/svrooij/sonos-api-docs/blob/main/docs/documentation.json) file. To easily add documentation to all services (that are generated with the generator). And it's json so you can easily use it yourself. ### Device discovery files @@ -81,7 +81,6 @@ specification. Contributions of any kind welcome! [badge_sponsor]: https://img.shields.io/github/sponsors/svrooij?logo=github&style=for-the-badge [badge_twitter]: https://img.shields.io/twitter/follow/svrooij?logo=twitter&style=for-the-badge - [link_sponsor]: https://github.com/sponsors/svrooij [link_issues]: https://github.com/svrooij/sonos-api-docs/issues [link_sonos-cli]: https://github.com/svrooij/sonos-cli diff --git a/generator/sonos-docs/data/sonos-S1-2.json b/generator/sonos-docs/data/sonos-S1-2.json index e964964..fb87b82 100644 --- a/generator/sonos-docs/data/sonos-S1-2.json +++ b/generator/sonos-docs/data/sonos-S1-2.json @@ -2,8 +2,8 @@ "model": "S1", "modelDescription": "Sonos Play:1", "softwareGeneration": 2, - "softwareVersion": "72.2-40060", - "discoveryDate": "2023-05-22T16:39:21.190Z", + "softwareVersion": "77.4-49290", + "discoveryDate": "2024-02-13T15:56:06.184Z", "services": [ { "name": "AlarmClock", @@ -2396,11 +2396,6 @@ "name": "FavoritesUpdateID", "dataType": "string", "sendEvents": true - }, - { - "name": "FavoritePresetsUpdateID", - "dataType": "string", - "sendEvents": true } ], "actions": [ @@ -2758,11 +2753,6 @@ "dataType": "string", "sendEvents": true }, - { - "name": "HTFreq", - "dataType": "ui4", - "sendEvents": true - }, { "name": "HTBondedZoneCommitState", "dataType": "ui4", @@ -2971,11 +2961,6 @@ "dataType": "boolean", "sendEvents": false }, - { - "name": "HTForwardEnabled", - "dataType": "boolean", - "sendEvents": false - }, { "name": "A_ARG_TYPE_RoomDetectionChirpChannel", "dataType": "ui2", @@ -3368,16 +3353,6 @@ } ] }, - { - "name": "GetHTForwardState", - "outputs": [ - { - "name": "IsHTForwardEnabled", - "direction": "out", - "relatedStateVariableName": "HTForwardEnabled" - } - ] - }, { "name": "SetButtonLockState", "inputs": [ diff --git a/generator/sonos-docs/data/sonos-S18-2.json b/generator/sonos-docs/data/sonos-S18-2.json index 1b8b8b9..214307e 100644 --- a/generator/sonos-docs/data/sonos-S18-2.json +++ b/generator/sonos-docs/data/sonos-S18-2.json @@ -2,8 +2,8 @@ "model": "S18", "modelDescription": "Sonos One", "softwareGeneration": 2, - "softwareVersion": "72.2-40060", - "discoveryDate": "2023-05-22T16:38:38.243Z", + "softwareVersion": "77.4-49290", + "discoveryDate": "2024-02-13T15:55:36.464Z", "services": [ { "name": "AlarmClock", @@ -2396,11 +2396,6 @@ "name": "FavoritesUpdateID", "dataType": "string", "sendEvents": true - }, - { - "name": "FavoritePresetsUpdateID", - "dataType": "string", - "sendEvents": true } ], "actions": [ @@ -2758,11 +2753,6 @@ "dataType": "string", "sendEvents": true }, - { - "name": "HTFreq", - "dataType": "ui4", - "sendEvents": true - }, { "name": "HTBondedZoneCommitState", "dataType": "ui4", @@ -2971,11 +2961,6 @@ "dataType": "boolean", "sendEvents": false }, - { - "name": "HTForwardEnabled", - "dataType": "boolean", - "sendEvents": false - }, { "name": "A_ARG_TYPE_RoomDetectionChirpChannel", "dataType": "ui2", @@ -3368,16 +3353,6 @@ } ] }, - { - "name": "GetHTForwardState", - "outputs": [ - { - "name": "IsHTForwardEnabled", - "direction": "out", - "relatedStateVariableName": "HTForwardEnabled" - } - ] - }, { "name": "SetButtonLockState", "inputs": [ diff --git a/generator/sonos-docs/data/sonos-S33-2.json b/generator/sonos-docs/data/sonos-S33-2.json index 6b7ffce..e66f1b4 100644 --- a/generator/sonos-docs/data/sonos-S33-2.json +++ b/generator/sonos-docs/data/sonos-S33-2.json @@ -2,8 +2,8 @@ "model": "S33", "modelDescription": "SYMFONISK Bookshelf", "softwareGeneration": 2, - "softwareVersion": "72.2-40060", - "discoveryDate": "2023-05-22T16:39:16.679Z", + "softwareVersion": "77.4-49290", + "discoveryDate": "2024-02-13T15:55:24.423Z", "services": [ { "name": "AlarmClock", @@ -2396,11 +2396,6 @@ "name": "FavoritesUpdateID", "dataType": "string", "sendEvents": true - }, - { - "name": "FavoritePresetsUpdateID", - "dataType": "string", - "sendEvents": true } ], "actions": [ @@ -2758,11 +2753,6 @@ "dataType": "string", "sendEvents": true }, - { - "name": "HTFreq", - "dataType": "ui4", - "sendEvents": true - }, { "name": "HTBondedZoneCommitState", "dataType": "ui4", @@ -2971,11 +2961,6 @@ "dataType": "boolean", "sendEvents": false }, - { - "name": "HTForwardEnabled", - "dataType": "boolean", - "sendEvents": false - }, { "name": "A_ARG_TYPE_RoomDetectionChirpChannel", "dataType": "ui2", @@ -3368,16 +3353,6 @@ } ] }, - { - "name": "GetHTForwardState", - "outputs": [ - { - "name": "IsHTForwardEnabled", - "direction": "out", - "relatedStateVariableName": "HTForwardEnabled" - } - ] - }, { "name": "SetButtonLockState", "inputs": [ diff --git a/generator/sonos-docs/data/sonos-S5-1.json b/generator/sonos-docs/data/sonos-S5-1.json index 5e178ce..7652cf4 100644 --- a/generator/sonos-docs/data/sonos-S5-1.json +++ b/generator/sonos-docs/data/sonos-S5-1.json @@ -2,8 +2,8 @@ "model": "S5", "modelDescription": "Sonos Play:5", "softwareGeneration": 1, - "softwareVersion": "57.15-39070", - "discoveryDate": "2023-05-22T16:39:34.654Z", + "softwareVersion": "57.19-49220", + "discoveryDate": "2024-02-13T15:56:10.829Z", "services": [ { "name": "AlarmClock", diff --git a/generator/sonos-docs/data/sonos-S9-2.json b/generator/sonos-docs/data/sonos-S9-2.json index 60e9c40..dc9d05f 100644 --- a/generator/sonos-docs/data/sonos-S9-2.json +++ b/generator/sonos-docs/data/sonos-S9-2.json @@ -2,8 +2,8 @@ "model": "S9", "modelDescription": "Sonos Playbar", "softwareGeneration": 2, - "softwareVersion": "72.2-40060", - "discoveryDate": "2023-05-22T16:38:57.120Z", + "softwareVersion": "77.4-49290", + "discoveryDate": "2024-02-13T15:55:46.307Z", "services": [ { "name": "AlarmClock", @@ -2396,11 +2396,6 @@ "name": "FavoritesUpdateID", "dataType": "string", "sendEvents": true - }, - { - "name": "FavoritePresetsUpdateID", - "dataType": "string", - "sendEvents": true } ], "actions": [ @@ -2758,11 +2753,6 @@ "dataType": "string", "sendEvents": true }, - { - "name": "HTFreq", - "dataType": "ui4", - "sendEvents": true - }, { "name": "HTBondedZoneCommitState", "dataType": "ui4", @@ -2971,11 +2961,6 @@ "dataType": "boolean", "sendEvents": false }, - { - "name": "HTForwardEnabled", - "dataType": "boolean", - "sendEvents": false - }, { "name": "A_ARG_TYPE_RoomDetectionChirpChannel", "dataType": "ui2", @@ -3368,16 +3353,6 @@ } ] }, - { - "name": "GetHTForwardState", - "outputs": [ - { - "name": "IsHTForwardEnabled", - "direction": "out", - "relatedStateVariableName": "HTForwardEnabled" - } - ] - }, { "name": "SetButtonLockState", "inputs": [ From 32d2fe827e16de388927fa9c3df275f442b4fc55 Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:27:27 +0100 Subject: [PATCH 2/7] chore: Docs refresh by latest software versions --- docs/services/alarm-clock.md | 8 ++++---- docs/services/av-transport.md | 8 ++++---- docs/services/connection-manager.md | 8 ++++---- docs/services/content-directory.md | 8 ++++---- docs/services/device-properties.md | 8 ++++---- docs/services/group-management.md | 8 ++++---- docs/services/group-rendering-control.md | 8 ++++---- docs/services/ht-control.md | 2 +- docs/services/index.md | 8 ++++---- docs/services/music-services.md | 8 ++++---- docs/services/q-play.md | 8 ++++---- docs/services/queue.md | 8 ++++---- docs/services/rendering-control.md | 8 ++++---- docs/services/system-properties.md | 8 ++++---- docs/services/virtual-line-in.md | 8 ++++---- docs/services/zone-group-topology.md | 8 ++++---- 16 files changed, 61 insertions(+), 61 deletions(-) diff --git a/docs/services/alarm-clock.md b/docs/services/alarm-clock.md index 2c9ea68..c5a8b45 100644 --- a/docs/services/alarm-clock.md +++ b/docs/services/alarm-clock.md @@ -450,15 +450,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/av-transport.md b/docs/services/av-transport.md index 14a359f..3abed90 100644 --- a/docs/services/av-transport.md +++ b/docs/services/av-transport.md @@ -1224,15 +1224,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/connection-manager.md b/docs/services/connection-manager.md index a573306..8e1e402 100644 --- a/docs/services/connection-manager.md +++ b/docs/services/connection-manager.md @@ -140,15 +140,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/content-directory.md b/docs/services/content-directory.md index d026b0f..31d76dc 100644 --- a/docs/services/content-directory.md +++ b/docs/services/content-directory.md @@ -435,15 +435,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/device-properties.md b/docs/services/device-properties.md index 6e25948..d599d22 100644 --- a/docs/services/device-properties.md +++ b/docs/services/device-properties.md @@ -679,15 +679,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/group-management.md b/docs/services/group-management.md index 732db6a..c27a017 100644 --- a/docs/services/group-management.md +++ b/docs/services/group-management.md @@ -158,15 +158,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/group-rendering-control.md b/docs/services/group-rendering-control.md index d76759c..55b3707 100644 --- a/docs/services/group-rendering-control.md +++ b/docs/services/group-rendering-control.md @@ -229,15 +229,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/ht-control.md b/docs/services/ht-control.md index 8ac8b8c..0a98fbc 100644 --- a/docs/services/ht-control.md +++ b/docs/services/ht-control.md @@ -212,4 +212,4 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | diff --git a/docs/services/index.md b/docs/services/index.md index 377f7ae..5ab7146 100644 --- a/docs/services/index.md +++ b/docs/services/index.md @@ -70,15 +70,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/music-services.md b/docs/services/music-services.md index 76669bd..5de36fc 100644 --- a/docs/services/music-services.md +++ b/docs/services/music-services.md @@ -136,15 +136,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/q-play.md b/docs/services/q-play.md index 8baacc0..4ba6974 100644 --- a/docs/services/q-play.md +++ b/docs/services/q-play.md @@ -78,15 +78,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/queue.md b/docs/services/queue.md index b64ce63..b2d75cd 100644 --- a/docs/services/queue.md +++ b/docs/services/queue.md @@ -385,15 +385,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/rendering-control.md b/docs/services/rendering-control.md index 713ec70..ad82f0d 100644 --- a/docs/services/rendering-control.md +++ b/docs/services/rendering-control.md @@ -738,15 +738,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/system-properties.md b/docs/services/system-properties.md index fc9ee98..39d7bed 100644 --- a/docs/services/system-properties.md +++ b/docs/services/system-properties.md @@ -444,15 +444,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/virtual-line-in.md b/docs/services/virtual-line-in.md index 745f194..a333da7 100644 --- a/docs/services/virtual-line-in.md +++ b/docs/services/virtual-line-in.md @@ -219,15 +219,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | diff --git a/docs/services/zone-group-topology.md b/docs/services/zone-group-topology.md index 937a7a7..db0d1c0 100644 --- a/docs/services/zone-group-topology.md +++ b/docs/services/zone-group-topology.md @@ -248,15 +248,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c | Device | Software generation | Software version | Discovery date | |:-------|:--------------------|:-----------------|:---------------| -| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z | +| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z | | `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z | | `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z | -| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z | +| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z | | `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z | | `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z | | `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z | -| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z | +| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z | | `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z | | `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z | -| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z | +| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z | | `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z | From 9fb5ca4e7494abcd1cfb939d13da9b6bede76fee Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:38:37 +0100 Subject: [PATCH 3/7] fix: music service name Fixed #32 --- generator/sonos-docs/src/commands/musicservices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/sonos-docs/src/commands/musicservices.ts b/generator/sonos-docs/src/commands/musicservices.ts index b0735cd..53b4dad 100644 --- a/generator/sonos-docs/src/commands/musicservices.ts +++ b/generator/sonos-docs/src/commands/musicservices.ts @@ -5,7 +5,7 @@ import * as path from 'path' import * as fs from 'fs' export default class Musicservices extends Command { - static description = 'describe the command here' + static description = 'List music services available on a Sonos speaker' static flags = { ...cli.table.flags(), From 9a2956d618bb96cd43f6f43e8e09a3964649f6e3 Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:40:53 +0100 Subject: [PATCH 4/7] fix: Template files for sonos-ts are moved to the actual library --- generator/sonos-docs/templates/ts/README.md | 23 --- .../sonos-docs/templates/ts/docs-index.hbs | 26 ---- .../sonos-docs/templates/ts/docs-service.hbs | 95 ------------ .../templates/ts/service-export.hbs | 14 -- generator/sonos-docs/templates/ts/service.hbs | 141 ------------------ .../sonos-docs/templates/ts/sonos-base.hbs | 98 ------------ .../templates/ts/sonos-upnp-errors.hbs | 17 --- .../sonos-docs/templates/ts/template.json | 85 ----------- 8 files changed, 499 deletions(-) delete mode 100644 generator/sonos-docs/templates/ts/README.md delete mode 100644 generator/sonos-docs/templates/ts/docs-index.hbs delete mode 100644 generator/sonos-docs/templates/ts/docs-service.hbs delete mode 100644 generator/sonos-docs/templates/ts/service-export.hbs delete mode 100644 generator/sonos-docs/templates/ts/service.hbs delete mode 100644 generator/sonos-docs/templates/ts/sonos-base.hbs delete mode 100644 generator/sonos-docs/templates/ts/sonos-upnp-errors.hbs delete mode 100644 generator/sonos-docs/templates/ts/template.json diff --git a/generator/sonos-docs/templates/ts/README.md b/generator/sonos-docs/templates/ts/README.md deleted file mode 100644 index dd8f0a1..0000000 --- a/generator/sonos-docs/templates/ts/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Sonos Typescript template - -This folder contains the template files for [sonos-ts](://svrooij.io/node-sonos-ts/). - -## Folder content - -| File | Description | Remarks | -|:-----|:------------|:--------| -| [docs-index](./docs-index.hbs) | Documentation Index | | -| [docs-service](./docs-service.hbs) | Service documentation | | -| [service-export](./service-export.hbs) | Service export | Exporting all the services to be available for one import | -| [service](./service.hbs) | Single service | Strong type service template, see [details](#sonos-service) | -| [sonos-base](./sonos-base.hbs) | Sonos base device | To enable generating a single class **SonosDevice** with a generated base | -| [sonos-upnp-errors](./sonos-upnp-errors.hbs) | All errors | Default sonos UPNP errors | - -## Sonos Service - -The [service file](./service.hbs) uses some extra handlebarjs handlers to get it to generate the correct file. - -Handlebars is used to generate the service but it doesn't support special `if` conditions, for instance to only add a piece of code when the variable is equal to something else. Since we want some pieces of code to only be added to specific services, the generator adds some special handlers. - -- **are_equal** is used like `{{#if (are_equal variable_name value)}}` sample `{{#if (are_equal serviceName 'AlarmClockService')}}` -- **or** is used like `{{#if (or (are_equal name 'Volume') (are_equal name 'Mute'))}}` diff --git a/generator/sonos-docs/templates/ts/docs-index.hbs b/generator/sonos-docs/templates/ts/docs-index.hbs deleted file mode 100644 index 5fdd3fc..0000000 --- a/generator/sonos-docs/templates/ts/docs-index.hbs +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: default -title: Services -parent: Sonos device -nav_order: 4 -has_children: true -has_toc: false ---- - -# Sonos SOAP Services -{: .no_toc } - -Every sonos speaker has several soap services. Each service has one or more actions you can call. - -## All services -{: .no_toc } - -| Service | Description | -|:--------|:------------| -{{#each services}} -| [**{{name}}**]({{kebabName}}-service.html) | {{description}} | -{{/each}} - ---- - -This file is automatically generated with [@svrooij/sonos-docs](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs), do not edit manually. diff --git a/generator/sonos-docs/templates/ts/docs-service.hbs b/generator/sonos-docs/templates/ts/docs-service.hbs deleted file mode 100644 index 40c944a..0000000 --- a/generator/sonos-docs/templates/ts/docs-service.hbs +++ /dev/null @@ -1,95 +0,0 @@ ---- -layout: default -title: {{serviceName}} -parent: Services -grand_parent: Sonos device ---- -# {{serviceName}} -{: .no_toc } -{{#if description}} - -{{description}} -{{/if}} -{{#if availableAt}} - -The {{serviceName}} is available on these models: {{#each availableAt}}`{{this}}`{{#unless @last}} / {{/unless}}{{/each}}. -{{/if}} - -```js -const SonosDevice = require('@svrooij/sonos').SonosDevice -const sonos = new SonosDevice('192.168.x.x') -sonos.{{serviceName}}.OneOfTheMethodsBelow({...}) -``` - -All actions that require input expect an object with the specified parameters, even if it only requires one parameter. - -1. TOC -{:toc} - ---- - -{{#each actions}} -### {{name}} -{{#if description}} - -{{description}} -{{/if}} -{{#if inputs}} - -```js -const result = await sonos.{{../serviceName}}.{{name}}({ {{#each inputs}}{{name}}:...{{#unless @last}}, {{/unless}}{{/each}} }); -``` - -Input object: - -| property | type | description | -|:----------|:-----|:------------| -{{#each inputs}} -| **{{name}}** | `{{{relatedStateVariable.dataType}}}` | {{{description}}}{{#if relatedStateVariable.allowedValues}} Allowed values: {{#each relatedStateVariable.allowedValues}}`{{this}}`{{#unless @last}} / {{/unless}}{{/each}}{{/if}} | -{{/each}} -{{else}} - -```js -const result = await sonos.{{../serviceName}}.{{name}}(); -``` -{{/if}} -{{#if outputs}} - -Output object: - -| property | type | description | -|:----------|:-----|:------------| -{{#each outputs}} -| **{{name}}** | `{{{relatedStateVariable.dataType}}}` | {{{description}}}{{#if relatedStateVariable.allowedValues}} Possible values: {{#each relatedStateVariable.allowedValues}}`{{this}}`{{#unless @last}} / {{/unless}}{{/each}}{{/if}} | -{{/each}} -{{else}} - -This actions returns a boolean whether or not the requests succeeded. -{{/if}} -{{#if remarks}} - -**Remarks** {{remarks}} -{{/if}} - -{{/each}} -{{#if eventVariables}} -## {{serviceName}} event - -```js -const SonosDevice = require('@svrooij/sonos').SonosDevice -const sonos = new SonosDevice('192.168.x.x') -sonos.{{serviceName}}.Events('serviceEvent', (data) => { - console.log(data); -}); -``` - -The **{{serviceName}}** emits events with these properties. Not all properties are emitted every time. - -| parameter | type | possible values | -|:----------|:-----|:----------------| -{{#each eventVariables}} -| **{{name}}** | `{{{dataType}}}` | {{#each allowedValues}}`{{this}}`{{#unless @last}} / {{/unless}}{{/each}} | -{{/each}} -{{/if}} - -This file is automatically generated with [@svrooij/sonos-docs](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs), do not edit manually. diff --git a/generator/sonos-docs/templates/ts/service-export.hbs b/generator/sonos-docs/templates/ts/service-export.hbs deleted file mode 100644 index 9b1019c..0000000 --- a/generator/sonos-docs/templates/ts/service-export.hbs +++ /dev/null @@ -1,14 +0,0 @@ -/** - * All sonos services exported as one file for easy access. - * - * Stephan van Rooij - * https://svrooij.io/sonos-api-docs - * - * This file is generated, do not edit manually. - */ -{{#each services}} -export * from './{{kebabName}}.service'; -{{#if data.extended}} -export * from './{{kebabName}}.service.extension'; -{{/if}} -{{/each}} \ No newline at end of file diff --git a/generator/sonos-docs/templates/ts/service.hbs b/generator/sonos-docs/templates/ts/service.hbs deleted file mode 100644 index e001661..0000000 --- a/generator/sonos-docs/templates/ts/service.hbs +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Sonos {{serviceName}} - * - * Stephan van Rooij - * https://svrooij.io - * - * This file is generated, do not edit manually. https://svrooij.io/sonos-api-docs - */ -{{#if data.importUrl}} -import { URL } from 'url'; -{{/if}} -import BaseService from './base-service'; -import { SonosUpnpError } from '../models/sonos-upnp-error'; -import SonosUpnpErrors from './sonos-upnp-errors'; -{{#if data.imports}} -import { - {{#each data.imports}}{{this}},{{#unless @last}} {{/unless}}{{/each}} -} from '../models'; -{{/if}} - -{{#if description}} -/** - * {{description}} - * - * @export - * @class {{serviceName}}{{#if data.extended}}Base{{/if}} - * @extends {BaseService} - */ -{{/if}} -export class {{serviceName}}{{#if data.extended}}Base{{/if}} extends BaseService{{#if eventVariables}}<{{serviceName}}Event>{{else}}{{/if}} { - readonly serviceNane: string = '{{name}}'; - - readonly controlUrl: string = '{{controlURL}}'; - - readonly eventSubUrl: string = '{{eventSubURL}}'; - - readonly scpUrl: string = '{{discoveryUri}}'; - - {{#if errors}} - /** - * Default errors and service specific errors - * - * @type {SonosUpnpError[]} - * @remarks See https://svrooij.io/sonos-api-docs/#manual-documentation-file - */ - readonly errors: SonosUpnpError[] = [ - ...SonosUpnpErrors.defaultErrors, - {{#each errors}} - { code: {{code}}, description: '{{description}}' }, - {{/each}} - ]; - {{else}} - readonly errors: SonosUpnpError[] = SonosUpnpErrors.defaultErrors; - {{/if}} - - // #region actions - {{#each actions}} - {{#if description}} - /** - * {{description}} - {{#if inputs}} - * - {{/if}} - {{#each inputs}} - * @param { {{~ relatedStateVariable.dataType ~}} } input.{{name}}{{#if description}} - {{{description}}}{{/if}}{{#if relatedStateVariable.allowedValues}} [ {{#each relatedStateVariable.allowedValues}}'{{this}}'{{#unless @last}} / {{/unless}}{{/each}} ]{{/if}} - {{/each}} - {{#if remarks}} - * @remarks {{{remarks}}} - {{/if}} - */ - {{/if}} - {{#if inputs}} - async {{name}}(input: { {{#each inputs}}{{name}}: {{relatedStateVariable.dataType}}{{#unless @last}}; {{/unless}}{{/each}} }{{{sonos_if_only_instance_id inputs ' = { InstanceID: 0 }'}}}): - {{#if outputs}} - Promise<{{name}}Response> { return await this.SoapRequestWithBody('{{name}}', input); } - {{else}} - Promise { return await this.SoapRequestWithBodyNoResponse('{{name}}', input); } - {{/if}} - {{else}} - async {{name}}(): - {{#if outputs}} - Promise<{{name}}Response> { return await this.SoapRequest<{{name}}Response>('{{name}}'); } - {{else}} - Promise { return await this.SoapRequestNoResponse('{{name}}'); } - {{/if}} - {{/if}} - {{#unless @last}} - - {{/unless}} - {{/each}} - // #endregion - {{#if outputVariables}} - - protected responseProperties(): {[key: string]: string} { - return { - {{#each outputVariables}} - {{@key}}: '{{{this}}}', - {{/each}} - }; - } - {{/if}} - {{#if eventVariables}} - - // Event properties from service description. - protected eventProperties(): {[key: string]: string} { - return { - {{#each eventVariables}} - {{name}}: '{{#if (or (are_equal name 'Volume') (are_equal name 'Mute'))}}{{#if (are_equal name 'Mute')}}ChannelValue{{else}}ChannelValue{{/if}}{{else}}{{{dataType}}}{{/if}}', - {{/each}} - }; - } - {{else}} - - // No properties in service description, throw error on retrieval. - protected eventProperties(): {[key: string]: string} { - throw new Error('No event properties in service definition'); - } - {{/if}} -} - -// Generated responses -{{#each actions}} -{{#if outputs}} -{{#unless (are_equal name 'Browse')}} -export interface {{name}}Response { - {{#each outputs}} - {{name}}: {{{relatedStateVariable.dataType}}}; - {{/each}} -} - -{{/unless}} -{{/if}} -{{/each}} -{{#if eventVariables}} -// Strong type event -export interface {{serviceName}}Event { - {{#each eventVariables}} - {{name}}?: {{#if (or (are_equal name 'Volume') (are_equal name 'Mute'))}}{{#if (are_equal name 'Mute')}}ChannelValue{{else}}ChannelValue{{/if}}{{else}}{{{dataType}}}{{/if}}; - {{/each}} -} -{{/if}} \ No newline at end of file diff --git a/generator/sonos-docs/templates/ts/sonos-base.hbs b/generator/sonos-docs/templates/ts/sonos-base.hbs deleted file mode 100644 index fdcc29e..0000000 --- a/generator/sonos-docs/templates/ts/sonos-base.hbs +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Sonos base device with all services defined. - * - * Stephan van Rooij - * https://svrooij.io/sonos-api-docs - * - * This file is generated, do not edit manually. - */ -import { Guid } from 'guid-typescript'; -import debug, { Debugger } from 'debug'; - -import { -{{#each services}} {{name}}Service, -{{/each}} -} from './services'; - -/** - * SonosDeviceBase is auto-generated to link to all available services of your Sonos Device - * - * @export - * @class SonosDeviceBase - */ -export default class SonosDeviceBase { - protected readonly host: string; - - protected readonly port: number; - - private debugger?: Debugger; - - protected get debug(): Debugger { - if (this.debugger === undefined) { - this.debugger = debug(`sonos:device:${this.host}`); - } - return this.debugger; - } - - protected uuid: string; - - /** - *Creates an instance of SonosDeviceBase. - * @param {string} host The IP of the speaker - * @param {number} [port=1400] The port, always 1400 - * @param {string} [uuid=Guid.create().toString()] The UUID of the speaker like RINCON_macaddres01400, used in some commands. - * @memberof SonosDeviceBase - */ - constructor(host: string, port = 1400, uuid: string = Guid.create().toString()) { - this.host = host; - this.port = port; - this.uuid = uuid; - } - - {{#each services}} - private {{lower name}}service: {{name}}Service | undefined; - - {{#if description}} - /** - * {{description}} - * will be initialized on first use. - * - * @readonly - * @type { {{~ name ~}} Service} - * @memberof SonosDeviceBase - */ - {{/if}} - public get {{name}}Service(): {{name}}Service { - if (this.{{lower name}}service === undefined) this.{{lower name}}service = new {{name}}Service(this.host, this.port, this.uuid); - return this.{{lower name}}service; - } - {{#unless @last}} - - {{/unless}} - {{/each}} - - /** - * Refresh all service event subscriptions, if you were already subscribed. - * - * @returns {Promise} returns true if at least one service subscription is refreshed. - * @memberof SonosDeviceBase - */ - public async RefreshEventSubscriptions(): Promise { - let result = false; - {{#each services}} - if (this.{{lower name}}service !== undefined) result = await this.{{lower name}}service.CheckEventListener() || result; - {{/each}} - return result; - } - - protected GetServiceByName(name: string): {{#each services}}{{name}}Service | {{/each}}undefined { - if (typeof name !== 'string' || name === '') return undefined; - const lowerName = name.toLowerCase(); - {{#each services}} - if (lowerName === '{{lower name}}service') { - return this.{{name}}Service; - } - {{/each}} - return undefined; - } -} diff --git a/generator/sonos-docs/templates/ts/sonos-upnp-errors.hbs b/generator/sonos-docs/templates/ts/sonos-upnp-errors.hbs deleted file mode 100644 index 88c4e62..0000000 --- a/generator/sonos-docs/templates/ts/sonos-upnp-errors.hbs +++ /dev/null @@ -1,17 +0,0 @@ -/** - * SonosUpnpErrors - * - * Stephan van Rooij - * https://svrooij.io - * - * This file is generated, do not edit manually. https://svrooij.io/sonos-api-docs - */ -import { SonosUpnpError } from '../models/sonos-upnp-error'; - -export default class SonosUpnpErrors { - public static defaultErrors: SonosUpnpError[] = [ - {{#each errors}} - { code: {{code}}, description: '{{description}}' }, - {{/each}} - ]; -} diff --git a/generator/sonos-docs/templates/ts/template.json b/generator/sonos-docs/templates/ts/template.json deleted file mode 100644 index fbae431..0000000 --- a/generator/sonos-docs/templates/ts/template.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "$schema": "https://svrooij.io/sonos-api-docs/schema/template.json", - "name": "Sonos Typescript", - "slug": "ts", - "repository": "https://github.com/svrooij/node-sonos-ts/", - "author": { - "name": "svrooij", - "link": "https://svrooij.io" - }, - "files": [ - { - "file": "docs-service.hbs", - "outputFile": "docs/sonos-device/services/{snService}-service.md", - "usage":"service" - }, - { - "file": "docs-index.hbs", - "outputFile": "docs/sonos-device/services/services.md", - "usage":"index" - }, - { - "file": "sonos-upnp-errors.hbs", - "outputFile": "src/services/sonos-upnp-errors.ts", - "usage":"index" - }, - { - "file": "service.hbs", - "outputFile": "src/services/{snService}.service.ts", - "usage":"service" - }, - { - "file": "service-export.hbs", - "outputFile": "src/services/index.ts", - "usage":"index" - }, - { - "file": "sonos-base.hbs", - "outputFile": "src/sonos-device-base.ts", - "usage":"index" - } - ], - "dataTypes": { - "ui4": "number", - "i4": "number", - "ui2": "number", - "i2": "number", - "MetaData": "Track | string", - "PlayMode": "PlayMode", - "ZoneGroupState": "Array | string" - }, - "serviceData": { - "AlarmClockService": { - "extended": true, - "imports": ["PlayMode", "Track"] - }, - "AVTransportService": { - "imports": ["PlayMode", "Track"] - }, - "ContentDirectoryService": { - "extended": true, - "imports": ["BrowseResponse"] - }, - "MusicServicesService": { - "extended": true - }, - "QueueService": { - "imports": ["BrowseResponse", "Track"] - }, - "RenderingControlService": { - "extended": true, - "imports": ["ChannelValue"] - }, - "SystemPropertiesService": { - "extended": true - }, - "VirtualLineInService": { - "imports":["Track"] - }, - "ZoneGroupTopologyService": { - "extended": true, - "imports":["ZoneGroup"] - } - }, - "license": "MIT" -} \ No newline at end of file From 4b6c1210e101f339d14fbe4665625913863fb9c2 Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:48:07 +0100 Subject: [PATCH 5/7] feat: Support for sample data --- docs/documentation.json | 13 +++++++++++++ docs/schema/documentation.json | 10 ++++++++++ docs/services/alarm-clock.md | 18 +++++++++--------- generator/sonos-docs/src/commands/combine.ts | 5 ++++- .../src/models/sonos-service-action.ts | 1 + .../src/models/sonos-service-documentation.ts | 1 + .../sonos-docs/templates/docs/service.hbs | 2 +- 7 files changed, 39 insertions(+), 11 deletions(-) diff --git a/docs/documentation.json b/docs/documentation.json index 039e004..6c18926 100644 --- a/docs/documentation.json +++ b/docs/documentation.json @@ -20,6 +20,19 @@ "Volume": "Volume between 0 and 100", "IncludeLinkedZones": "Should grouped players also play the alarm?", "AssignedID": "The ID of the new alarm" + }, + "sample": { + "StartLocalTime": "07:00:00", + "Duration": "00:30:00", + "Recurrence": "DAILY", + "Enabled": "1", + "RoomUUID": "RINCON_000E58FE3AEA01400", + "ProgramURI": "x-rincon-buzzer:0", + "ProgramMetaData": "", + "PlayMode": "NORMAL", + "Volume": "20", + "IncludeLinkedZones": "1", + "AssignedID": "1" } }, "DestroyAlarm": { diff --git a/docs/schema/documentation.json b/docs/schema/documentation.json index 9ef2344..07dbcf1 100644 --- a/docs/schema/documentation.json +++ b/docs/schema/documentation.json @@ -51,6 +51,16 @@ }, "type": "object" }, + "sample": { + "title": "Sample values", + "description": "Sample values for the parameters", + "additionalProperties": { + "title": "Value", + "description": "Working value, by it name as key", + "type": "string" + }, + "type": "object" + }, "remarks": { "title": "Action remarks", "description": "Remarks about this action", diff --git a/docs/services/alarm-clock.md b/docs/services/alarm-clock.md index c5a8b45..a02251c 100644 --- a/docs/services/alarm-clock.md +++ b/docs/services/alarm-clock.md @@ -55,16 +55,16 @@ Action body: ```xml - string - string - string - boolean - string - string + 07:00:00 + 00:30:00 + DAILY + 1 + RINCON_000E58FE3AEA01400 + x-rincon-buzzer:0 string - string - ui2 - boolean + NORMAL + 20 + 1 ``` diff --git a/generator/sonos-docs/src/commands/combine.ts b/generator/sonos-docs/src/commands/combine.ts index 57c9333..3064c61 100644 --- a/generator/sonos-docs/src/commands/combine.ts +++ b/generator/sonos-docs/src/commands/combine.ts @@ -29,7 +29,7 @@ export default class Combine extends Command { }), docsFile: flags.string({ exclusive: ['docsUrl'], - description: 'File location of documenation, instead of url.', + description: 'File location of documentation, instead of url.', }), models: flags.string({ default: 'S1-2,S3-2,S6-2,S9-2,S13-2,S14-2,S18-2,S21-2,S27-2,S33-2,S38-2,Sub-2', @@ -216,12 +216,15 @@ export default class Combine extends Command { a.description = action?.description a.remarks = action?.remarks const actionArguments = action?.params ?? {} + const sampleData = action?.sample ?? {} if (actionArguments) { a.inputs?.forEach(i => { i.description = actionArguments[i.name] ?? (i.name === 'InstanceID' ? 'InstanceID should always be `0`' : undefined) + i.sample = sampleData[i.name] }) a.outputs?.forEach(o => { o.description = actionArguments[o.name] + o.sample = sampleData[o.name] }) } } diff --git a/generator/sonos-docs/src/models/sonos-service-action.ts b/generator/sonos-docs/src/models/sonos-service-action.ts index 9232da7..7583a0b 100644 --- a/generator/sonos-docs/src/models/sonos-service-action.ts +++ b/generator/sonos-docs/src/models/sonos-service-action.ts @@ -15,4 +15,5 @@ export interface SonosServiceActionArgument { relatedStateVariableName: string; relatedStateVariable?: SonosStateVariable; description?: string; + sample?: unknown; } diff --git a/generator/sonos-docs/src/models/sonos-service-documentation.ts b/generator/sonos-docs/src/models/sonos-service-documentation.ts index 0045412..e2ea4db 100644 --- a/generator/sonos-docs/src/models/sonos-service-documentation.ts +++ b/generator/sonos-docs/src/models/sonos-service-documentation.ts @@ -19,4 +19,5 @@ export interface SonosServiceDocumentationAction { description?: string; remarks?: string; params?: { [key: string]: string }; + sample?: { [key: string]: string }; } diff --git a/generator/sonos-docs/templates/docs/service.hbs b/generator/sonos-docs/templates/docs/service.hbs index 5a6b125..914b45d 100644 --- a/generator/sonos-docs/templates/docs/service.hbs +++ b/generator/sonos-docs/templates/docs/service.hbs @@ -63,7 +63,7 @@ Action body: ```xml {{#each inputs}} - <{{name}}>{{relatedStateVariable.dataType}} + <{{name}}>{{#if sample}}{{sample}}{{else}}{{relatedStateVariable.dataType}}{{/if}} {{/each}} ``` From 6e2b934e9996108e62311af1afcbb3891b3619a5 Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:49:14 +0100 Subject: [PATCH 6/7] chore: Some linting errors solved --- README.md | 8 ++++---- docs/documentation.json | 2 +- docs/music-services.md | 4 ++-- docs/services/av-transport.md | 2 +- docs/services/index.md | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5f1bbfd..9dcb632 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Unofficial Sonos docs -[![Sonos api documentation][badge_sonos-docs]][link_sonos-docs] +[![Sonos API documentation][badge_sonos-docs]][link_sonos-docs] [![Github Issues][badge_issues]][link_issues] [![Sonos2mqtt][badge_sonos-mqtt]][link_sonos-mqtt] [![Sonos cli][badge_sonos-cli]][link_sonos-cli] @@ -9,15 +9,15 @@ [![Support me on Github][badge_sponsor]][link_sponsor] [![Follow on Twitter][badge_twitter]][link_twitter] -Sonos api documentation for the local UPNP api and a [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to generate clients and documentation based on service discovery +Sonos API documentation for the local UPNP API and a [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to generate clients and documentation based on service discovery -This library is in no way connected to [Sonos](//en.wikipedia.org/wiki/Sonos). It's just a set of text files to document a hidden and **unsupported** api. +This library is in no way connected to [Sonos](//en.wikipedia.org/wiki/Sonos). It's just a set of text files to document a hidden and **unsupported** API. ## Documentation Check-out the (generated) documentation about all the SONOS UPNP services [svrooij.io/sonos-api-docs/services/](https://sonos.svrooij.io/services/) -[![Sonos api documentation][badge_sonos-docs]][link_sonos-docs] +[![Sonos API documentation][badge_sonos-docs]][link_sonos-docs] [Read documentation](https://sonos.svrooij.io/) diff --git a/docs/documentation.json b/docs/documentation.json index 6c18926..59e1144 100644 --- a/docs/documentation.json +++ b/docs/documentation.json @@ -72,7 +72,7 @@ "description": "Control line in" }, "AVTransportService": { - "description": "Service that controls stuff related to transport (play/pause/next/special urls)", + "description": "Service that controls stuff related to transport (play/pause/next/special URLs)", "actions": { "AddURIToQueue": { "description": "Adds songs to the SONOS queue", diff --git a/docs/music-services.md b/docs/music-services.md index 50d7a37..a8ff0d3 100644 --- a/docs/music-services.md +++ b/docs/music-services.md @@ -245,7 +245,7 @@ You should get a response that looks like this (Spofity result): This results in: -- `regUrl` this is the url you should visit in the browser, it will ask you to login. +- `regUrl` this is the URL you should visit in the browser, it will ask you to login. - `linkCode` this is sometimes needed to fill in on the page. And you'll need it for the next step. #### AppLink - Step 2 @@ -338,7 +338,7 @@ With the following body: This will results in a response with at least the following data: -- `regUrl` this is the url you should visit in the browser, it will ask you to login. +- `regUrl` this is the URL you should visit in the browser, it will ask you to login. - `linkCode` this is sometimes needed to fill in on the page. And you'll need it for the next step. Continue with [applink - step 2](#applink---step-2) after visiting the **regUrl** in the browser. diff --git a/docs/services/av-transport.md b/docs/services/av-transport.md index 3abed90..bf5fd04 100644 --- a/docs/services/av-transport.md +++ b/docs/services/av-transport.md @@ -6,7 +6,7 @@ parent: Sonos Services # AVTransport service {: .no_toc } -Service that controls stuff related to transport (play/pause/next/special urls) +Service that controls stuff related to transport (play/pause/next/special URLs) The AVTransport service is available on these models: `Sonos Play:1 (S1) S2` / `Sonos One (S13) S2` / `Sonos Beam (S14) S2` / `Sonos One (S18) S2` / `SYMFONISK Bookshelf (S21) S2` / `Sonos Roam (S27) S2` / `Sonos Play:3 (S3) S2` / `SYMFONISK Bookshelf (S33) S2` / `Sonos One SL (S38) S2` / `Sonos Play:5 (S6) S2` / `Sonos Playbar (S9) S2` / `Sonos Sub (Sub) S2`. diff --git a/docs/services/index.md b/docs/services/index.md index 5ab7146..b2de2ec 100644 --- a/docs/services/index.md +++ b/docs/services/index.md @@ -23,7 +23,7 @@ These documents can provide you with some extra guidelines. More details can be |:--------|:------------| | [**AlarmClock**](alarm-clock.html) | Control the sonos alarms and times | | [**AudioIn**](audio-in.html) | Control line in | -| [**AVTransport**](av-transport.html) | Service that controls stuff related to transport (play/pause/next/special urls) | +| [**AVTransport**](av-transport.html) | Service that controls stuff related to transport (play/pause/next/special URLs) | | [**ConnectionManager**](connection-manager.html) | Services related to connections and protocols | | [**ContentDirectory**](content-directory.html) | Browse for local content | | [**DeviceProperties**](device-properties.html) | Modify device properties, like LED status and stereo pairs | From d0f1479c9c71003a94b5ad52ed07ef82a4a8159a Mon Sep 17 00:00:00 2001 From: Stephan van Rooij <1292510+svrooij@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:14:18 +0100 Subject: [PATCH 7/7] docs: Modified some links --- .github/ISSUE_TEMPLATE/config.yml | 7 +++++++ README.md | 4 ++++ docs/developers.md | 10 ++++++---- docs/index.md | 8 +++----- docs/sonos-communication.md | 14 ++++++-------- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0..16cba5f 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,8 @@ blank_issues_enabled: false +contact_links: + - name: Questions + url: https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a + about: Please ask and answer questions here. + - name: All discussions + url: https://github.com/svrooij/sonos-api-docs/discussions + about: General discussions about the Sonos API. \ No newline at end of file diff --git a/README.md b/README.md index 9dcb632..c55e5eb 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ You can use the generator to generate your own discovery files, but we also have These files together with the documentation file, are combined to a extensive JSON file, that is used as an input for the generator. +## Community + +If you have any [questions](https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a) or you want to [show](https://github.com/svrooij/sonos-api-docs/discussions/categories/show-and-tell) your Sonos integration. Please join us in the [discussions](https://github.com/svrooij/sonos-api-docs/discussions) tab on this repository. + ## Contributors ✨ diff --git a/docs/developers.md b/docs/developers.md index 935770f..cceace1 100644 --- a/docs/developers.md +++ b/docs/developers.md @@ -55,7 +55,7 @@ For example [this part](https://github.com/svrooij/sonos-api-docs/blob/25aad3a3a We build a custom [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to do several things. -### Discover services from sonos speaker +### Discover services from Sonos speaker You can use the generator to generate [device discovery files]({{ '/#device-discovery-files' | relative_url }}). For each model we generated a discovery json, as available on main page. We generate this file by parsing the device discovery document available at `http://{sonos_ip}:1400/xml/device_description.xml`. Not every model has the same services, but it seems that if a service is available it's the same as all other models that have that service. @@ -74,9 +74,11 @@ npm install ./bin/run services {sonos-ip} ``` +Please help us out occasionally by running this command on your own Sonos speaker and send us the resulting file. This way we can keep the discovery files up to date. This command will automatically update the discovery files in the `data` folder. These files are used as an input for the generator. Having up to date discovery files will help us to keep the documentation up to date. All personal identifiable information is removed from the discovery files. + ### Combine discovery files and documentation -If you changed the [documentation.json](#documentation.json) file or if you added/updated discovery files, you need to combine the two into one file, the **.cache/combined.json** file. +If you changed the [documentation.json](./documentation.json) file or if you added/updated discovery files, you need to combine the two into one file, the **.cache/combined.json** file. This file is the result of the the manual documentation and the device discovery files. This file is almost 8000 lines of json at the moment, which is why it is ignored in git. Being able to inspect this json file should really help in debugging the generator. @@ -101,7 +103,7 @@ npx @svrooij/sonos-docs combine --docsFile=./docs/documentation.json --folder=./ ### Regenerate documentation -Once you generated the **combined.json** file, you can use the generator to (re)generate the [service documentation]({{ '/services' | relative_url }}). This step is mandatory if you changed either the **documentation.json** or if you added/updated one of the discovery files. +Once you generated the **combined.json** file, you can use the generator to (re)generate the [service documentation]({{ '/services' | relative_url }}). This step is mandatory if you changed either the **documentation.json** or if you added/updated one of the discovery files. The resulting files, are **not to be changed manually**, since changes will get lost upon the next generation. @@ -135,7 +137,7 @@ The template.json file gives some basic information about the template, the auth 1. File usage `index`, will use the data from intermediate.json as input to produce **one file**. 2. File usage `service`, will use the data from each service to produce **one file per service**, be sure to use `{snService}` or `{service}` in the **outputFile**. -Be sure to check out the [docs template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/docs) to get started. Or the [ts template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/ts), which is used to generate [sonos-ts](https://svrooij.io/node-sonos-ts/). +Be sure to check out the [docs template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/docs) to get started. Or the [ts template](https://github.com/svrooij/node-sonos-ts/tree/master/.generator/ts), which is used to generate [Sonos typescript](https://sonos-ts.svrooij.io/). ```bash diff --git a/docs/index.md b/docs/index.md index 2ee2067..4011a63 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,7 +38,7 @@ This file has a [documentation json schema](https://sonos.svrooij.io/schema/docu ### Update documentation -If you change the [documentation](#manual-documentation-file) file or if you did service discovery for a new device. You can update the documentation files with the following commands: +If you change the [documentation](#manually-documented) file or if you did service discovery for a new device. You can update the documentation files with the following commands: ```shell # Go to generation folder @@ -55,7 +55,7 @@ npm run docs ## Generator -You can find the generator [here](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) and use it to generate your own sonos client in your preferred language. +You can find the generator [here](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) and use it to generate your own Sonos client in your preferred language. ### Device discovery files @@ -84,9 +84,7 @@ The template.json also has a [json schema](https://svrooij.io/sonos-api-docs/sch ## Community -[![Join us on Discord][badge_discord]][link_discord] - -If you need help building an app that talks to your sonos speakers, or you want to share some of your findings. [Join us on Discord][link_discord]. +If you have any [questions](https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a) or you want to [show](https://github.com/svrooij/sonos-api-docs/discussions/categories/show-and-tell) your Sonos integration. Please join us in the [discussions](https://github.com/svrooij/sonos-api-docs/discussions) tab on this repository. ## Contributors ✨ diff --git a/docs/sonos-communication.md b/docs/sonos-communication.md index 38ab2df..140ba96 100644 --- a/docs/sonos-communication.md +++ b/docs/sonos-communication.md @@ -21,7 +21,7 @@ Each sonos speaker has [several soap services]({{'services/' | relative_url }}) ## Sonos SOAP remarks - Sonos communicates booleans as `1` for true and `0` for false. This is something to keep in mind if you see **boolean** somewhere. -- Some actions (like [ListAlarms]({{'services/alarm-clock.html#listalarms' | relative_url }})) return encoded xml as string. Before you can read these, you'll have to decode them and then parse them as XML. Libraries like [node-sonos-ts](https://svrooij.io/node-sonos-ts/sonos-device/services/alarm-clock-service.html#listalarms) provide a way that already parses the the output so you don't have to. +- Some actions (like [ListAlarms]({{'services/alarm-clock.html#listalarms' | relative_url }})) return encoded xml as string. Before you can read these, you'll have to decode them and then parse them as XML. Libraries like [node-sonos-ts](https://sonos-ts.svrooij.io/sonos-device/services/alarm-clock-service.html#listalarms) provide a way that already parses the the output so you don't have to. ## SOAP call @@ -33,7 +33,7 @@ In this sample we described the [SetMute]({{ '/services/rendering-control.html#s | ---- | ------ | | IP of speaker | `192.168.0.31` | | [Control endpoint]({{'/services/rendering-control.html#service-data' | relative_url }}) | `/MediaRenderer/RenderingControl/Control` | -| Service type | `urn:schemas-upnp-org:service:RenderingControl:1` +| Service type | `urn:schemas-upnp-org:service:RenderingControl:1` | You can find this information on the page describing one of [many sonos services]({{'/services/' | relative_url }}). @@ -50,7 +50,7 @@ soapaction: "urn:schemas-upnp-org:service:RenderingControl:1#SetMute" Content-Type: text/xml; charset="utf-8" ``` -The body of the request has to be specified as XML. We also added the correct action body for the `SetMute` action. As you see below, booleans are converted to `1` for true and `0` for false. This is just how sonos works. +The body of the request has to be specified as XML. We also added the correct action body for the `SetMute` action. As you see below, booleans are converted to `1` for true and `0` for false. This is just how Sonos works. ```xml @@ -82,15 +82,13 @@ Success message (without output parameters) to above command: Generic error (when deleting an alarm that doesn't exists) body (HTTP status code 500): ```xml - + s:Client UPnPError - + 800 @@ -117,7 +115,7 @@ Apart from the soap services, sonos also has some http endpoints available where ## Auto discovery Each sonos speaker can be discovered by the [SSDP](https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol) or **Simple Service Discovery Protocol**. -In short each speaker listens for a `ssdp:discovery` command. +In short each speaker listens for a `ssdp:discovery` command. Which is actually just a simple UDP packet send to port `1900` on multicast address `239.255.255.250` and `255.255.255.255` with the following body: