From 3bbbd5edaa11a207a9cee7775d81f0632cddc03d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 16 Jun 2019 21:47:36 +0200 Subject: [PATCH 1/2] new font-awesome commits --- platypush/backend/http/static/font-awesome | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/http/static/font-awesome b/platypush/backend/http/static/font-awesome index bdfa9823..fcbfba1f 160000 --- a/platypush/backend/http/static/font-awesome +++ b/platypush/backend/http/static/font-awesome @@ -1 +1 @@ -Subproject commit bdfa9823c8b1e25a5c822f6c719ec0e38ead7f71 +Subproject commit fcbfba1f7e445f3e135b311cb92cefdaa2634fb9 From df355fb9541359e081c72de0d80a67b2458762f0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 16 Jun 2019 21:54:03 +0200 Subject: [PATCH 2/2] Fixed typos and warnings in snapcast backend --- platypush/backend/music/snapcast.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platypush/backend/music/snapcast.py b/platypush/backend/music/snapcast.py index dab792a9..c660deef 100644 --- a/platypush/backend/music/snapcast.py +++ b/platypush/backend/music/snapcast.py @@ -34,7 +34,7 @@ class MusicSnapcastBackend(Backend): _DEFAULT_POLL_SECONDS = 10 # Poll servers each 10 seconds _SOCKET_EOL = '\r\n'.encode() - def __init__(self, hosts=['localhost'], ports=[_DEFAULT_SNAPCAST_PORT], + def __init__(self, hosts=None, ports=None, poll_seconds=_DEFAULT_POLL_SECONDS, *args, **kwargs): """ :param hosts: List of Snapcast server names or IPs to monitor (default: @@ -52,6 +52,11 @@ class MusicSnapcastBackend(Backend): super().__init__(*args, **kwargs) + if hosts is None: + hosts = ['localhost'] + if ports is None: + ports = [self._DEFAULT_SNAPCAST_PORT] + self.hosts = hosts[:] self.ports = ports[:] self.poll_seconds = poll_seconds @@ -123,7 +128,7 @@ class MusicSnapcastBackend(Backend): elif msg.get('method') == 'Group.OnStreamChanged': group_id = msg.get('params', {}).get('id') stream_id = msg.get('params', {}).get('stream_id') - evt = GroupStreamChangeEvent(host=host, group=group, stream=stream) + evt = GroupStreamChangeEvent(host=host, group=group_id, stream=stream_id) elif msg.get('method') == 'Stream.OnUpdate': stream_id = msg.get('params', {}).get('stream_id') stream = msg.get('params', {}).get('stream') @@ -137,10 +142,9 @@ class MusicSnapcastBackend(Backend): def _client(self, host, port): def _thread(): set_thread_name('Snapcast-' + host) - status = None try: - status = self._status(host, port) + self._status(host, port) except Exception as e: self.logger.warning(('Exception while getting the status ' + 'of the Snapcast server {}:{}: {}'). @@ -200,7 +204,7 @@ class MusicSnapcastBackend(Backend): except Exception as e: self.logger.warning('Unable to connect to {}:{}: {}'.format( host, port, str(e))) - self._socks[hosts] = None + self._socks[host] = None def run(self): super().run()