Skip to content

Commit

Permalink
lms: trigger syncgroups query when syncing two players, update syncgr…
Browse files Browse the repository at this point in the history
…oups with empty value if currently no groups exist
  • Loading branch information
onkelandy committed Dec 23, 2024
1 parent 7e5d3e4 commit 3f2ec6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,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
4 changes: 2 additions & 2 deletions lms/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
'playercount': {'read': True, 'write': False, 'read_cmd': 'player count ?', 'item_type': 'num', 'dev_datatype': 'str', 'reply_pattern': r'^player count (\d+)', 'custom_disable': True, 'item_attrs': {'initial': True}},
'favoritescount': {'read': True, 'write': False, 'read_cmd': 'favorites items', 'item_type': 'num', 'dev_datatype': 'str', 'reply_pattern': r'^favorites items\s+ count:(\d+)', 'custom_disable': True, 'item_attrs': {'initial': True}},
'syncgroups': {
'members': {'read': True, 'write': False, 'read_cmd': 'syncgroups ?', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': r'^syncgroups sync_members:(.*) sync_member_names:', 'custom_disable': True, 'item_attrs': {'initial': True}},
'names': {'read': True, 'write': False, 'read_cmd': 'syncgroups ?', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': r'^syncgroups sync_members:.* sync_member_names:(.*)', 'custom_disable': True, 'item_attrs': {'initial': False}},
'members': {'read': True, 'write': False, 'read_cmd': 'syncgroups ?', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': [r'^syncgroups sync_members:(.*) sync_member_names:', r'^syncgroups(.*)?$'], 'custom_disable': True, 'item_attrs': {'initial': True}},
'names': {'read': True, 'write': False, 'read_cmd': 'syncgroups ?', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': [r'^syncgroups sync_members:.* sync_member_names:(.*)', r'^syncgroups(.*)?$'], 'custom_disable': True, 'item_attrs': {'initial': False}},
}
},
'database': {
Expand Down

0 comments on commit 3f2ec6b

Please sign in to comment.