Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDP plugins: fix and improve plugin.yaml based on newest changes #957

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion denon/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
'volume': {'read': True, 'write': True, 'read_cmd': 'MV?', 'write_cmd': 'MV{VALUE}', 'item_type': 'num', 'dev_datatype': 'DenonVol', 'reply_pattern': r'MV(\d{2,3})', 'cmd_settings': {'force_min': 0.0, 'valid_max': 98.0}, 'item_attrs': {'initial': True}},
'volumeup': {'read': False, 'write': True, 'item_type': 'bool', 'write_cmd': 'MVUP', 'dev_datatype': 'raw'},
'volumedown': {'read': False, 'write': True, 'write_cmd': 'MVDOWN', 'item_type': 'bool', 'dev_datatype': 'raw'},
'volumemax': {'opcode': '{VALUE}', 'read': True, 'write': False, 'item_type': 'num', 'dev_datatype': 'str', 'reply_pattern': r'MVMAX (\d{2,3})'},
'volumemax': {'opcode': '{VALUE}', 'read': True, 'write': False, 'item_type': 'num', 'dev_datatype': 'str', 'reply_pattern': r'MVMAX (\d{2,3})', 'item_attrs': {'read_group_levels': 0}},
'input': {'read': True, 'write': True, 'read_cmd': 'SI?', 'write_cmd': 'SI{VALUE}', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': 'SI{LOOKUP}', 'lookup': 'INPUT', 'item_attrs': {'item_template': 'input', 'initial': True}},
'listeningmode': {'read': True, 'write': True, 'cmd_settings': {'valid_list_ci': ['MOVIE', 'MUSIC', 'GAME', 'DIRECT', 'PURE DIRECT', 'STEREO', 'AUTO', 'DOLBY DIGITAL', 'DOLBY SURROUND', 'DTS SURROUND', 'NEURAL:X', 'AURO3D', 'AURO2DSURR', 'MCH STEREO', 'ROCK ARENA', 'JAZZ CLUB', 'MONO MOVIE', 'MATRIX', 'VIDEO GAME', 'VIRTUAL', 'LEFT', 'RIGHT']}, 'read_cmd': 'MS?', 'write_cmd': 'MS{RAW_VALUE_UPPER}', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': r'\s?MS(.*)', 'item_attrs': {'initial': True}},
'sleep': {'read': True, 'write': True, 'item_type': 'num', 'read_cmd': 'SLP?', 'write_cmd': 'SLP{VALUE}', 'dev_datatype': 'convert0', 'reply_pattern': r'SLP(\d{3}|OFF)', 'cmd_settings': {'force_min': 0, 'force_max': 120}, 'item_attrs': {'initial': True}},
Expand Down
64 changes: 44 additions & 20 deletions denon/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

plugin:
type: interface
description: Denon AV-Receiver

description:
de: Denon AV-Receiver
en: Denon AV-Receiver
maintainer: OnkelAndy
tester: Morg
state: develop
Expand Down Expand Up @@ -160,17 +163,18 @@ parameters:
description:
de: Anzahl Sendeversuche
en: number of sending retries

description_long:
de: 'Anzahl Sendeversuche\n
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: 'number of sending retries\n
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
value is more than 0.
'

sendretry_cycle:
type: num
Expand All @@ -180,17 +184,18 @@ parameters:
description:
de: Pause zwischen Durchgängen von Sendeversuchen
en: wait time between sending retry rounds

description_long:
de: 'Pause zwischen Durchgängen von Sendeversuchen\n
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: 'wait time between sending retry rounds\n
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)
where no (suiting) answer got received.
'

delay_initial_read:
type: num
Expand All @@ -203,9 +208,10 @@ parameters:
resume_initial_read:
type: bool
defaul: false

description:
de: 'Bei resume vom Plugin erstmaliges Lesen erneut durchführen'
en: 'Repeat initial read on resume'
de: Bei resume vom Plugin erstmaliges Lesen erneut durchführen
en: Repeat initial read on resume

connect_cycle:
type: num
Expand Down Expand Up @@ -305,8 +311,26 @@ 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: "Der Inhalt der Lookup-Tabelle mit dem angegebenen Namen wird beim\nStart einmalig als dict oder list in das Item geschrieben.\n\n\nDurch Anhängen von \"#<mode>\" an den Namen der Tabelle kann die Art\nder Tabelle ausgewählt werden:\n- fwd liefert die Tabelle Gerät -> SmartHomeNG (Standard)\n- rev liefert die Tabelle SmartHomeNG -> Gerät\n- rci liefert die Tabelle SmarthomeNG -> Gerät in Kleinbuchstaben\n- list liefert die Liste der Namen für SmartHomeNG (z.B. für Auswahllisten in der Visu)"
en: "The lookup table with the given name will be assigned to the item\nin dict or list format once on startup.\n\n\nBy appending \"#<mode>\" to the tables name the type of table can\nbe selected:\n- fwd returns the table device -> SmartHomeNG (default)\n- rev returns the table SmartHomeNG -> device\n- rci returns the table SmartHomeNG -> device in lower case\n- list return the list of names for SmartHomeNG (e.g. for selection dropdowns in visu applications)"
de: |4-
Der Inhalt der Lookup-Tabelle mit dem angegebenen Namen wird beim
Start einmalig als dict oder list in das Item geschrieben.

Durch Anhängen von "#<mode>" an den Namen der Tabelle kann die Art
der Tabelle ausgewählt werden:
- fwd liefert die Tabelle Gerät -> SmartHomeNG (Standard)
- 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: |4-
The lookup table with the given name will be assigned to the item
in dict or list format once on startup.

By appending "#<mode>" to the tables name the type of table can
be selected:
- fwd returns the table device -> SmartHomeNG (default)
- rev returns the table SmartHomeNG -> device
- rci returns the table SmartHomeNG -> device in lower case
- list return the list of names for SmartHomeNG (e.g. for selection dropdowns in visu applications)

item_structs:

Expand Down Expand Up @@ -1620,7 +1644,7 @@ item_structs:
- zone2.settings.sound
- zone2.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone2.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -1820,7 +1844,7 @@ item_structs:
enforce_updates: true
denon_read_group_trigger@instance: zone3.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone3.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -3897,7 +3921,7 @@ item_structs:
- AVR-X6300H.zone2.settings.sound
- AVR-X6300H.zone2.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone2.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -4108,7 +4132,7 @@ item_structs:
enforce_updates: true
denon_read_group_trigger@instance: AVR-X6300H.zone3.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone3.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -5123,7 +5147,7 @@ item_structs:
- AVR-X4300H.zone2.settings.sound
- AVR-X4300H.zone2.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone2.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -5334,7 +5358,7 @@ item_structs:
enforce_updates: true
denon_read_group_trigger@instance: AVR-X4300H.zone3.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone3.settings.sound.general.HPF
denon_read@instance: true
Expand Down Expand Up @@ -6357,7 +6381,7 @@ item_structs:
- AVR-X3300W.zone2.settings.sound
- AVR-X3300W.zone2.settings.sound.general

hpf:
HPF:
type: bool
denon_command@instance: zone2.settings.sound.general.HPF
denon_read@instance: true
Expand Down
55 changes: 39 additions & 16 deletions lms/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

plugin:
type: interface
description: Logitech Mediaserver
description:
de: Logitech Mediaserver
en: Logitech Mediaserver
maintainer: OnkelAndy
tester: Morg
state: develop
keywords: iot device logitechmediaserver lms sdp av
version: 1.5.3
version: '1.5.3'
sh_minversion: '1.9.5'
py_minversion: '3.7'
sdp_minversion: '1.0.3'
Expand Down Expand Up @@ -135,17 +137,18 @@ parameters:
description:
de: Anzahl Sendeversuche
en: number of sending retries

description_long:
de: 'Anzahl Sendeversuche\n
de: |
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: 'number of sending retries\n
en: |
number of sending retries\n
If no (suiting) answer is received after sending
a command the command is resent as long as this
value is more than 0.
'

sendretry_cycle:
type: num
Expand All @@ -155,17 +158,18 @@ parameters:
description:
de: Pause zwischen Durchgängen von Sendeversuchen
en: wait time between sending retry rounds

description_long:
de: 'Pause zwischen Durchgängen von Sendeversuchen\n
de: |
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: 'wait time between sending retry rounds\n
en: |
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)
where no (suiting) answer got received.
'

delay_initial_read:
type: num
Expand All @@ -178,9 +182,10 @@ parameters:
resume_initial_read:
type: bool
defaul: false

description:
de: 'Bei resume vom Plugin erstmaliges Lesen erneut durchführen'
en: 'Repeat initial read on resume'
de: Bei resume vom Plugin erstmaliges Lesen erneut durchführen
en: Repeat initial read on resume

item_attributes:

Expand Down Expand Up @@ -241,8 +246,26 @@ 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: "Der Inhalt der Lookup-Tabelle mit dem angegebenen Namen wird beim\nStart einmalig als dict oder list in das Item geschrieben.\n\n\nDurch Anhängen von \"#<mode>\" an den Namen der Tabelle kann die Art\nder Tabelle ausgewählt werden:\n- fwd liefert die Tabelle Gerät -> SmartHomeNG (Standard)\n- rev liefert die Tabelle SmartHomeNG -> Gerät\n- rci liefert die Tabelle SmarthomeNG -> Gerät in Kleinbuchstaben\n- list liefert die Liste der Namen für SmartHomeNG (z.B. für Auswahllisten in der Visu)"
en: "The lookup table with the given name will be assigned to the item\nin dict or list format once on startup.\n\n\nBy appending \"#<mode>\" to the tables name the type of table can\nbe selected:\n- fwd returns the table device -> SmartHomeNG (default)\n- rev returns the table SmartHomeNG -> device\n- rci returns the table SmartHomeNG -> device in lower case\n- list return the list of names for SmartHomeNG (e.g. for selection dropdowns in visu applications)"
de: |-
Der Inhalt der Lookup-Tabelle mit dem angegebenen Namen wird beim
Start einmalig als dict oder list in das Item geschrieben.

Durch Anhängen von "#<mode>" an den Namen der Tabelle kann die Art
der Tabelle ausgewählt werden:
- fwd liefert die Tabelle Gerät -> SmartHomeNG (Standard)
- 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: |-
The lookup table with the given name will be assigned to the item
in dict or list format once on startup.

By appending "#<mode>" to the tables name the type of table can
be selected:
- fwd returns the table device -> SmartHomeNG (default)
- rev returns the table SmartHomeNG -> device
- rci returns the table SmartHomeNG -> device in lower case
- list return the list of names for SmartHomeNG (e.g. for selection dropdowns in visu applications)

sqb_custom1:
type: str
Expand Down Expand Up @@ -382,7 +405,7 @@ item_structs:
duration_format:
type: str
eval: "'{}d {}h {}i {}s'.format(int(sh...()//86400), int((sh...()%86400)//3600), int((sh...()%3600)//60), round((sh...()%3600)%60))"
eval_trigger: ..
eval_trigger: '..'

totalartists:
type: num
Expand Down Expand Up @@ -1146,7 +1169,7 @@ item_structs:
duration_format:
type: str
eval: "'{}d {}h {}i {}s'.format(int(sh...()//86400), int((sh...()%86400)//3600), int((sh...()%3600)//60), round((sh...()%3600)%60))"
eval_trigger: ..
eval_trigger: '..'

totalartists:
type: num
Expand Down
Loading
Loading