Skip to content

Commit

Permalink
lms plugin: test current playlist rename
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Nov 18, 2024
1 parent f28a462 commit db1e5e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lms/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
'playlist': {
'rename': {'read': False, 'write': True, 'write_cmd': '{CUSTOM_ATTR1} playlists rename {VALUE}', 'item_type': 'str', 'dev_datatype': 'raw', 'reply_pattern': r'{CUSTOM_PATTERN1} playlists rename\s+(.*)'},
'rename_current': {'read': False, 'write': True, 'item_type': 'str', 'write_cmd': '{CUSTOM_ATTR1} playlists rename {VALUE}', 'dev_datatype': 'str', 'reply_pattern': r'{CUSTOM_PATTERN1} playlists rename\s+(.*)', 'item_attrs': {'eval': 'f"playlist_id:{sh...id()} newvalue:{value}" if not ":" in value else value'}},
'rename_current': {'read': False, 'write': True, 'item_type': 'str', 'write_cmd': '{CUSTOM_ATTR1} playlists rename playlist_id:{CURRENT_LIST_ID} newvalue:{VALUE}', 'dev_datatype': 'str', 'reply_pattern': r'{CUSTOM_PATTERN1} playlists rename\s+(.*)', 'item_attrs': {'eval': 'f"playlist_id:{sh...id()} newvalue:{value}" if not ":" in value else value'}},
'repeat': {'read': True, 'write': True, 'read_cmd': '{CUSTOM_ATTR1} playlist repeat ?', 'item_type': 'str', 'write_cmd': '{CUSTOM_ATTR1} playlist repeat {VALUE}', 'dev_datatype': 'str', 'reply_pattern': [r'{CUSTOM_PATTERN1} playlist repeat {LOOKUP}', '{CUSTOM_PATTERN1} status(?:.*)playlist repeat:{LOOKUP}'], 'lookup': 'REPEAT', 'item_attrs': {'attributes': {'remark': '0 = Off, 1 = Song, 2 = Playlist'}, 'lookup_item': True}},
'shuffle': {'read': True, 'write': True, 'read_cmd': '{CUSTOM_ATTR1} playlist shuffle ?', 'item_type': 'str', 'write_cmd': '{CUSTOM_ATTR1} playlist shuffle {VALUE}', 'dev_datatype': 'str', 'reply_pattern': [r'{CUSTOM_PATTERN1} playlist shuffle {LOOKUP}', '{CUSTOM_PATTERN1} status(?:.*)playlist shuffle:{LOOKUP}'], 'lookup': 'SHUFFLE', 'item_attrs': {'attributes': {'remark': '0 = Off, 1 = Song, 2 = Album'}, 'lookup_item': True}},
'index': {'read': True, 'write': True, 'read_cmd': '{CUSTOM_ATTR1} playlist index ?', 'write_cmd': '{CUSTOM_ATTR1} playlist index {VALUE}', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': [r'{CUSTOM_PATTERN1} playlist (?:index|newsong .*) (\d+)$', '{CUSTOM_PATTERN1} status(?:.*)playlist index:(\d*[^\s]+)', '{CUSTOM_PATTERN1} prefset server currentSong (\d+)$', '{CUSTOM_PATTERN1} playlist jump (\d+)', '{CUSTOM_PATTERN1} play (\d*)'], 'item_attrs': {'initial': True}},
Expand Down
35 changes: 25 additions & 10 deletions lms/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

plugin:
type: interface

description:
de: Logitech Mediaserver
en: Logitech Mediaserver
de: Logitech Mediaserver
en: Logitech Mediaserver
maintainer: OnkelAndy
tester: Morg
state: develop
Expand Down Expand Up @@ -139,12 +140,12 @@ parameters:
en: number of sending retries

description_long:
de: |
de: |4
Anzahl Sendeversuche\n
Kommt keine (passende) Antwort nach dem Senden
eines Commands zurück, wird das Kommando nochmals
gesendet, sofern der Wert über 0 liegt.
en: |
en: |4
number of sending retries\n
If no (suiting) answer is received after sending
a command the command is resent as long as this
Expand All @@ -160,12 +161,12 @@ parameters:
en: wait time between sending retry rounds

description_long:
de: |
de: |4
Pause zwischen Durchgängen von Sendeversuchen\n
Sind Send Retries aktiv, wird ein Scheduler erstellt,
der im angegebenen Sekundentakt Kommandos erneut sendet,
zu denen keine (passenden) Antworten erhalten wurden.
en: |
en: |4
wait time between sending retry rounds\n
If send retries are active, a scheduler gets added
that resends commands in the given cycle value (in seconds)
Expand Down Expand Up @@ -246,7 +247,7 @@ item_attributes:
en: The lookup table with the given name will be assigned to the item in dict or list format once on startup.

description_long:
de: |-
de: |4-
Der Inhalt der Lookup-Tabelle mit dem angegebenen Namen wird beim
Start einmalig als dict oder list in das Item geschrieben.
Expand All @@ -256,7 +257,7 @@ item_attributes:
- rev liefert die Tabelle SmartHomeNG -> Gerät
- rci liefert die Tabelle SmarthomeNG -> Gerät in Kleinbuchstaben
- list liefert die Liste der Namen für SmartHomeNG (z.B. für Auswahllisten in der Visu)
en: |-
en: |4-
The lookup table with the given name will be assigned to the item
in dict or list format once on startup.
Expand Down Expand Up @@ -677,7 +678,13 @@ item_structs:
type: str
sqb_command@instance: player.playlist.rename
sqb_read@instance: false
sqb_write@instance: false
sqb_write@instance: true

rename_current:
type: str
sqb_command@instance: player.playlist.rename_current
sqb_read@instance: false
sqb_write@instance: true

repeat:
type: str
Expand Down Expand Up @@ -756,6 +763,7 @@ item_structs:
sqb_read@instance: true
sqb_write@instance: true
enforce_updates: true
remark: <Genre> <Artist> <Album>. You can use * for any of the entries. Spaces need to be replaced by %20

loadtracks:
type: str
Expand Down Expand Up @@ -1453,7 +1461,13 @@ item_structs:
type: str
sqb_command@instance: player.playlist.rename
sqb_read@instance: false
sqb_write@instance: false
sqb_write@instance: true

rename_current:
type: str
sqb_command@instance: player.playlist.rename_current
sqb_read@instance: false
sqb_write@instance: true

repeat:
type: str
Expand Down Expand Up @@ -1537,6 +1551,7 @@ item_structs:
sqb_read@instance: true
sqb_write@instance: true
enforce_updates: true
remark: <Genre> <Artist> <Album>. You can use * for any of the entries. Spaces need to be replaced by %20

loadtracks:
type: str
Expand Down

0 comments on commit db1e5e7

Please sign in to comment.