iobroker.squeezeboxrpc 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,7 +58,7 @@ all needed informations or send commands to the server/players.
58
58
  - After installation or update, it may sometimes be necessary\
59
59
  to execute the following command if problems have arisen in vis-1
60
60
 
61
- `iobroker upload squeezeboxpc`
61
+ `iobroker upload squeezeboxrpc`
62
62
 
63
63
  ## Provided states
64
64
 
@@ -452,16 +452,75 @@ The widged dosent refresh automaticly, you have to press the refreshh button.
452
452
  | --------------------- | ----------------- | ----------------------------------------------------------------- |
453
453
  | Player widget | General group | Selection of the player widget. |
454
454
 
455
+ The widget itself has very little formatting.
456
+ For self formating there are some predefined css-classes:
457
+
458
+ | CSS-class | description |
459
+ | ---------- | ----------------------------------------- |
460
+ | plcontainer| Class name assigned to the ul-tag |
461
+ | plentry | Class name assigned to the li-tag |
462
+ | plrefresh | Class name assigned to the refresh-li tag |
463
+ | pltext | Class name assigned to the playlist name |
464
+
465
+ The following CSS for the vis-css tab can serve as an example:
466
+
467
+ Dark-mode
468
+
469
+ ```css
470
+ .plentry {
471
+ border: 1px #505050 groove;
472
+ margin:1px 0px;
473
+ padding:5px;
474
+ background-color:#202020;
475
+ }
476
+ .plrefresh {
477
+ padding:5px;
478
+ }
479
+ .plentry:hover {
480
+ background-color:#404040;
481
+ }
482
+ .plrefresh svg {
483
+ color:#cccccc;
484
+ }
485
+ .plrefresh svg:hover {
486
+ color:#ffffff;
487
+ filter: drop-shadow(0px 0px 1px #87ceeb);
488
+ }
489
+ ```
490
+
491
+ Light-mode
492
+
493
+ ```css
494
+ .plentry {
495
+ border: 1px #b0b0b0 groove;
496
+ margin:1px 0px;
497
+ padding:5px;
498
+ background-color:#c0c0c0;
499
+ }
500
+ .plrefresh {
501
+ padding:5px;
502
+ }
503
+ .plentry:hover {
504
+ background-color:#e0e0e0;
505
+ }
506
+ .plrefresh svg {
507
+ color:#444444;
508
+ }
509
+ .plrefresh svg:hover {
510
+ color:#000000;
511
+ filter: drop-shadow(0px 0px 1px #87ceeb);
512
+ }
513
+ ```
514
+
455
515
  ## SendTo-Befehle
456
516
 
457
517
  ### cmdGeneral
458
518
 
459
- Mit diesem Befehl können beliebige Befehle an den LMS-Server gesendet werden,
460
- um eine Rückmeldung zu erhalten.
519
+ This command can be used to send any command to the LMS server to receive a response.
461
520
 
462
- Beispiel:
521
+ Example:
463
522
 
464
- _Alle Playlists:_
523
+ **All Playlists:**
465
524
 
466
525
  ```js
467
526
  async function main() {
@@ -474,9 +533,9 @@ async function main() {
474
533
  main();
475
534
  ```
476
535
 
477
- _Alle Favoriten:_
536
+ **All Favorites:**
478
537
 
479
- Dieser Befehl wird vom Adapter intern verwendet, um die Favoriten zu laden.
538
+ This command is used internally by the adapter to load the favorites.
480
539
 
481
540
  ```js
482
541
  async function main() {
@@ -489,8 +548,8 @@ async function main() {
489
548
  main();
490
549
  ```
491
550
 
492
- Weitere Möglichkeiten und Detailbeschreibung über die Parameter sind in
493
- der folgenden CLI-Dokumentation enthalten:
551
+ Further options and detailed descriptions of the parameters
552
+ are contained in the following CLI documentation:
494
553
 
495
554
  [CLI-Documentation](#further-api-documentation)
496
555
 
@@ -522,10 +581,24 @@ der folgenden CLI-Dokumentation enthalten:
522
581
  ### **WORK IN PROGRESS**
523
582
 
524
583
  -->
584
+ ### 1.5.2 (2024-12-16)
585
+
586
+ - fix spelling of iobroker upload squeezeboxrpc in readme
587
+ - fix playtime bar
588
+
589
+ ### 1.5.1 (2024-11-29)
590
+
591
+ - improve documentation
592
+ - remove margin from plcontainer
593
+ - improve textoverflow with ellipsis
594
+ - adjust initial widgetsize of playlist widget
595
+ - repair attributes for playlist widget
596
+ - add light mode css for playlist widget
597
+
525
598
  ### 1.5.0 (2024-11-28)
526
599
 
527
- - Umstellung auf iobroker/eslint
528
- - Neues Widget playlist
600
+ - Switch to iobroker/eslint
601
+ - New widget playlist
529
602
 
530
603
  ### 1.4.0 (2024-11-27)
531
604
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "squeezeboxrpc",
4
- "version": "1.5.0",
4
+ "version": "1.5.2",
5
5
  "news": {
6
+ "1.5.2": {
7
+ "en": "fix spelling of iobroker upload squeezeboxrpc in readme\nfix playtime bar",
8
+ "de": "fix buchstabierung von iobroker laden pressboxrpc in readme\nspielzeitleiste",
9
+ "ru": "фиксация iobroker загрузки сжатиеboxrpc в считывании\nисправить плей-тайм",
10
+ "pt": "correção ortografia de iobroker upload espremedorpc em readme\ncorrigir a barra de playtime",
11
+ "nl": "fix spelling van iobroker upload cleaseboxrpc in readme\nspeelbalk herstellen",
12
+ "fr": "corriger l'orthographe du téléchargement d'iobroker streetboxrpc dans readme\nfixer la barre de temps de jeu",
13
+ "it": "correzione ortografia di iobroker upload spreboxrpc in readme\nfix playtime bar",
14
+ "es": "fijación de la ortografía de iobroker subido apretboxrpc en readme\nbarra de juego",
15
+ "pl": "naprawić pisownię iobroker wysyłania squeezeboxrpc w readme\nnaprawić pasek czasu odtwarzania",
16
+ "uk": "фіксувати заклинання iobroker upload squeezeboxrpc в читме\nфіксувати час гри",
17
+ "zh-cn": "在readme中固定 iobroster 上传压缩盒的拼写\n修复播放时间栏"
18
+ },
19
+ "1.5.1": {
20
+ "en": "improve documentation\nremove margin from plcontainer\nimprove textoverflow with ellipsis\nadjust initial widgetsize of playlist widget\nrepair attributes for playlist widget\nadd light mode css for playlist widget",
21
+ "de": "verbesserung der dokumentation\nentfernen sie den rand von plcontainer\ntextoverflow mit ellipsis verbessern\neinstellen der ersten widgetsize der wiedergabeliste widget\nreparatur-attribute für playlist widget\nlichtmodus css für playlist widget hinzufügen",
22
+ "ru": "улучшение документации\nудалить маржу от plcontainer\nулучшить текстовый поток с эллипсисом\nнастроить первоначальный виджет\nатрибуты для воспроизведения виджета\nдобавить режим cs для виджета списка воспроизведения",
23
+ "pt": "melhorar a documentação\nremover a margem do plcontainer\nmelhorar o fluxo de texto com ellipsis\najustar o widget inicial do widget da lista de reprodução\natributos de reparo para widget de lista de reprodução\nadd light mode css para widget da lista de reprodução",
24
+ "nl": "de documentatie verbeteren\nde marge uit plcontainer verwijderen\nverbeteren textoverflow met ellipsis\nde initiële widgetgrootte van afspeellijstwidget aanpassen\nreparatie attributen voor afspeellijst widget\nlichtmodus css toevoegen voor afspeellijstwidget",
25
+ "fr": "améliorer la documentation\nenlever la marge du plcontainer\naméliorer le textoverflow avec ellipse\najustez le widget initial du widget playlist\nattributs de réparation pour widget playlist\najouter le mode lumière css pour le widget playlist",
26
+ "it": "migliorare la documentazione\nrimuovere il margine da plcontainer\nmigliorare il flusso di testo con ellipsis\nregolare la dimensione iniziale del widget di playlist\nattributi di riparazione per widget di playlist\naggiungere css modalità di luce per widget di playlist",
27
+ "es": "mejorar la documentación\neliminar el margen de plcontainer\nmejorar el flujo de textover con elipsis\najustar el widgetsize inicial del widget de lista de reproducción\natributos de reparación para el widget de lista\nañadir light mode css para el widget de lista de reproducción",
28
+ "pl": "poprawić dokumentację\nusunąć margines z plakietki\npoprawić przepływ tekstuwerwiru za pomocą elipsy\ndostosować początkowy rozmiar widgetsize widget listy odtwarzania\nnaprawa atrybutów widgetu listy odtwarzania\ndodaj tryb światła css dla widżetu listy odtwarzania",
29
+ "uk": "вдосконалення документації\nприбрати запас від plcontainer\nполіпшення текстового потоку з еліпсом\nналаштування початкового віджетурозміри віджету\nвідремонтувати атрибути для відтворення віджету\nadd light режим css для playlist віджет",
30
+ "zh-cn": "改进文件编制\n从容器中删除边距\n改进带有椭圆的文本流\n调整播放列表部件的初始部件大小\n播放列表部件的修复属性\n为播放列表部件添加轻模式 ccs"
31
+ },
6
32
  "1.5.0": {
7
33
  "en": "Umstellung auf iobroker/eslint\nNeues Widget playlist",
8
34
  "de": "Anpassung an iobroker/eslint\nNeues Widget Playlist",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.squeezeboxrpc",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "ioBroker Logitech Squeezebox Adapter over JSON/RPC-Protocol",
5
5
  "author": {
6
6
  "name": "oweitman",
@@ -53,7 +53,7 @@
53
53
  var version;
54
54
  var init_package = __esm({
55
55
  "../package.json"() {
56
- version = "1.5.0";
56
+ version = "1.5.1";
57
57
  }
58
58
  });
59
59
 
@@ -1900,14 +1900,18 @@
1900
1900
  }
1901
1901
  const stateid_duration = `${data.ainstance.join(".")}.Players.${playername}.Duration`;
1902
1902
  const stateid_state = `${data.ainstance.join(".")}.Players.${playername}.state`;
1903
+ const stateid_time = `${data.ainstance.join(".")}.Players.${playername}.Time`;
1903
1904
  const state_duration = vis.states[`${stateid_duration}.val`] || vis.states[`${stateid_duration}.val`] === 0 ? parseInt(vis.states[`${stateid_duration}.val`]) : 0;
1904
1905
  const state_state = vis.states[`${stateid_state}.val`] || vis.states[`${stateid_state}.val`] === 0 ? parseInt(vis.states[`${stateid_state}.val`]) : 0;
1905
- let width = state_duration == 0 ? 0 : width;
1906
+ const state_time = vis.states[`${stateid_time}.val`] || vis.states[`${stateid_time}.val`] === 0 ? parseInt(vis.states[`${stateid_time}.val`]) : 0;
1907
+ let width = state_duration == 0 ? 0 : $(`#${widgetID} div.playtimebar`).width();
1906
1908
  if (state_state == 2) {
1907
1909
  width = 0;
1908
1910
  }
1909
1911
  if (vis.editMode) {
1910
1912
  width = 50;
1913
+ } else {
1914
+ width = Math.floor(state_time / state_duration * 100);
1911
1915
  }
1912
1916
  $(`#${widgetID} div.playtimebar`).width(`${width}%`);
1913
1917
  }
@@ -2000,23 +2004,32 @@
2000
2004
  let result = yield vis.binds["squeezeboxrpc"].getPlaylistData(ainstance.join("."));
2001
2005
  let playlist = result.result.playlists_loop;
2002
2006
  let text = "";
2003
- text += "<style>";
2004
- text += `#${widgetID} ul.plcontainer { `;
2005
- text += " list-style-type: none;";
2006
- text += " padding-left: 0px;";
2007
- text += " color:white;";
2008
- text += "}";
2009
- text += `#${widgetID} li.plentry { `;
2010
- text += " cursor: pointer;";
2011
- text += "}";
2012
- text += `#${widgetID} li.plrefresh { `;
2013
- text += " width: 1em;";
2014
- text += " height: 1em;";
2015
- text += " margin: 5px 0px;";
2016
- text += "}";
2017
- text += "</style>";
2007
+ text += `
2008
+ <style>
2009
+ #${widgetID} ul.plcontainer {
2010
+ list-style-type: none;
2011
+ padding-left: 0px;
2012
+ margin: 0px;
2013
+ }
2014
+ #${widgetID} li.plentry {
2015
+ cursor: pointer;
2016
+ height: 1em;
2017
+ margin: 5px 0px;
2018
+ }
2019
+ #${widgetID} li.plentry div {
2020
+ text-overflow: ellipsis;
2021
+ overflow: hidden;
2022
+ white-space: nowrap;
2023
+ }
2024
+ #${widgetID} li.plrefresh {
2025
+ width: 1em;
2026
+ height: 1em;
2027
+ margin: 5px 0px;
2028
+ }
2029
+ </style>
2030
+ `;
2018
2031
  text += '<ul class="plcontainer">';
2019
- text += '<li class="plrefresh"><svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RefreshIcon"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"></path></svg></li>';
2032
+ text += '<li class="plrefresh"><div><svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RefreshIcon"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"></path></svg></div></li>';
2020
2033
  for (let i = 0; i < playlist.length; i++) {
2021
2034
  let pl = playlist[i];
2022
2035
  text += `<li class="plentry"><div class="pltext" data-plid="${pl.id}" data-pln="${playername}" data-ins="${ainstance.join(".")}" onclick="vis.binds.squeezeboxrpc.playlist.onclickplaylist(this,event)">${pl.playlist}</div></li>`;
@@ -1664,6 +1664,7 @@ vis.binds['squeezeboxrpc'] = {
1664
1664
  }
1665
1665
  const stateid_duration = `${data.ainstance.join('.')}.Players` + `.${playername}.Duration`;
1666
1666
  const stateid_state = `${data.ainstance.join('.')}.Players` + `.${playername}.state`;
1667
+ const stateid_time = `${data.ainstance.join('.')}.Players` + `.${playername}.Time`;
1667
1668
 
1668
1669
  const state_duration =
1669
1670
  vis.states[`${stateid_duration}.val`] || vis.states[`${stateid_duration}.val`] === 0
@@ -1673,12 +1674,19 @@ vis.binds['squeezeboxrpc'] = {
1673
1674
  vis.states[`${stateid_state}.val`] || vis.states[`${stateid_state}.val`] === 0
1674
1675
  ? parseInt(vis.states[`${stateid_state}.val`])
1675
1676
  : 0;
1676
- let width = state_duration == 0 ? 0 : width;
1677
+ const state_time =
1678
+ vis.states[`${stateid_time}.val`] || vis.states[`${stateid_time}.val`] === 0
1679
+ ? parseInt(vis.states[`${stateid_time}.val`])
1680
+ : 0;
1681
+
1682
+ let width = state_duration == 0 ? 0 : $(`#${widgetID} div.playtimebar`).width();
1677
1683
  if (state_state == 2) {
1678
1684
  width = 0;
1679
1685
  } //0 if player stop
1680
1686
  if (vis.editMode) {
1681
1687
  width = 50;
1688
+ } else {
1689
+ width = Math.floor((state_time / state_duration) * 100);
1682
1690
  }
1683
1691
  $(`#${widgetID} div.playtimebar`).width(`${width}%`);
1684
1692
  },
@@ -1781,26 +1789,33 @@ vis.binds['squeezeboxrpc'] = {
1781
1789
  let result = await vis.binds['squeezeboxrpc'].getPlaylistData(ainstance.join('.'));
1782
1790
  let playlist = result.result.playlists_loop;
1783
1791
  let text = '';
1784
- text += '<style>';
1785
- text += `#${widgetID} ul.plcontainer { `;
1786
- text += ' list-style-type: none;';
1787
- text += ' padding-left: 0px;';
1788
- text += ' color:white;';
1789
- text += '}';
1790
- text += `#${widgetID} li.plentry { `;
1791
- text += ' cursor: pointer;';
1792
- text += '}';
1793
-
1794
- text += `#${widgetID} li.plrefresh { `;
1795
- text += ' width: 1em;';
1796
- text += ' height: 1em;';
1797
- text += ' margin: 5px 0px;';
1798
- text += '}';
1799
-
1800
- text += '</style>';
1792
+ text += `
1793
+ <style>
1794
+ #${widgetID} ul.plcontainer {
1795
+ list-style-type: none;
1796
+ padding-left: 0px;
1797
+ margin: 0px;
1798
+ }
1799
+ #${widgetID} li.plentry {
1800
+ cursor: pointer;
1801
+ height: 1em;
1802
+ margin: 5px 0px;
1803
+ }
1804
+ #${widgetID} li.plentry div {
1805
+ text-overflow: ellipsis;
1806
+ overflow: hidden;
1807
+ white-space: nowrap;
1808
+ }
1809
+ #${widgetID} li.plrefresh {
1810
+ width: 1em;
1811
+ height: 1em;
1812
+ margin: 5px 0px;
1813
+ }
1814
+ </style>
1815
+ `;
1801
1816
  text += '<ul class="plcontainer">';
1802
1817
  text +=
1803
- '<li class="plrefresh"><svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RefreshIcon"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"></path></svg></li>';
1818
+ '<li class="plrefresh"><div><svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="RefreshIcon"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"></path></svg></div></li>';
1804
1819
  for (let i = 0; i < playlist.length; i++) {
1805
1820
  let pl = playlist[i];
1806
1821
  text += `<li class="plentry"><div class="pltext" data-plid="${pl.id}" data-pln="${playername}" data-ins="${ainstance.join('.')}" onclick="vis.binds.squeezeboxrpc.playlist.onclickplaylist(this,event)">${pl.playlist}</div></li>`;
@@ -225,13 +225,13 @@
225
225
  type="text/ejs"
226
226
  class="vis-tpl"
227
227
  data-vis-prev='<img src="widgets/squeezeboxrpc/img/playlist.png"></img>'
228
- data-vis-attrs="widgetPlayer/custom;"
228
+ data-vis-attrs="widgetPlayer/custom,squeezeboxrpc.attrSelect;"
229
229
  data-vis-set="squeezeboxrpc"
230
230
  data-vis-type="static"
231
231
  data-vis-beta="false"
232
232
  data-vis-update-style="true"
233
233
  data-vis-name="Playlist">
234
- <div class="vis-widget <%== this.data.attr('class') %>" style="width: 50px; height: 20px;overflow:auto;scrollbar-width: none" id="<%= this.data.attr('wid') %>"><%
234
+ <div class="vis-widget <%== this.data.attr('class') %>" style="width: 200px; height: 200px;overflow:auto;scrollbar-width: none" id="<%= this.data.attr('wid') %>"><%
235
235
  vis.binds.squeezeboxrpc.playlist.createWidget(this.data.wid, this.view, this.data, this.style);
236
236
  %></div>
237
237
  </script>