happyleavesaoc/python-snapcast

Changes from Android don't reflect

HazWard opened this issue · 1 comments

When changing like volume and toggling mute from the Android application, the changes are applied, however when I try to get information of all the clients the values are not updated. Is there a way to force the Python module to sync its information with what snapserver provides?

I found a fix to force synchronization

# Connect to Snapserver
loop = asyncio.get_event_loop()
server = loop.run_until_complete(snapcast.control.create_server(loop, address))

def sync_snapcast():
    """Update the server with new state"""
    status = loop.run_until_complete(server.status())
    server.synchronize(status)