Skip to content

Commit

Permalink
Merge pull request #989 from onkelandy/lms
Browse files Browse the repository at this point in the history
Logitech Media Server: some major updates for command handling
  • Loading branch information
onkelandy authored Dec 23, 2024
2 parents 0fac7fa + 8761e92 commit 5b68c8d
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 139 deletions.
9 changes: 7 additions & 2 deletions lms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SmartPluginWebIf():
class lms(SmartDevicePlugin):
""" Device class for Logitech Mediaserver/Squeezebox function. """

PLUGIN_VERSION = '1.5.3'
PLUGIN_VERSION = '1.6.0'

def _set_device_defaults(self):
self.custom_commands = 1
Expand Down Expand Up @@ -107,6 +107,7 @@ def trigger_read(command):
trigger_read('info.playlists.names')
# set alarm
if command == f'player.control.alarms{CUSTOM_SEP}{custom}':
return
# This does not really work currently. The created string is somehow correct.
# However, much more logic has to be included to add/update/delete alarms, etc.
try:
Expand All @@ -115,7 +116,7 @@ def trigger_read(command):
alarm = f"id:{i} "
for k, v in d.items():
alarm += f"{k}:{v} "
alarm = f"alarm add {alarm.strip()}"
alarm = f"add {alarm.strip()}"
self.logger.debug(f"Set alarm: {alarm}")
self.send_command('player.control.set_alarm' + CUSTOM_SEP + custom, alarm)
except Exception as e:
Expand Down Expand Up @@ -143,6 +144,10 @@ def trigger_read(command):
self.logger.debug(f"Got command id {command} data {data} value {value} custom {custom} by {by}")
trigger_read('player.playlist.name')

if command == f'player.control.sync{CUSTOM_SEP}{custom}':
self.logger.debug(f"Got command sync {command} data {data} value {value} custom {custom} by {by}")
trigger_read('server.syncgroups.members')

# update on new song
if command == f'player.info.title{CUSTOM_SEP}{custom}':
# trigger_read('player.control.playmode')
Expand Down
Loading

0 comments on commit 5b68c8d

Please sign in to comment.