From 2d91dce6d048b0bb250be199a5e0761df55aa759 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Wed, 23 Mar 2016 14:47:29 -0400 Subject: [PATCH] Assume we only run one Logitech Media server on a host. Because the LMS discovery mechanism uses the SlimProto protocol to discover the presence of a Logitech Media server which operates on port 3483/udp and 3483/tcp. But HA uses a different 'CLI' protocol that is typically on port 9090/tcp to query player state. However the CLI port number is configurable and if someone runs the CLI on a different port, and has the server configured in configuration.yaml, we get an error in the logs when we try to connect to 9090/tcp when we find the server through discovery. Because of the way local slim player discover the server using SlimProto we can be fairly certain only a single server will run on a given IP address so if one is already configured with a user defined port, we should ignore the discovered one that assumes the default port. --- homeassistant/components/media_player/squeezebox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/media_player/squeezebox.py b/homeassistant/components/media_player/squeezebox.py index ef795ef305b..d49eba609e1 100644 --- a/homeassistant/components/media_player/squeezebox.py +++ b/homeassistant/components/media_player/squeezebox.py @@ -42,9 +42,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): return False # Only add a media server once - if (host, port) in KNOWN_DEVICES: + if host in KNOWN_DEVICES: return False - KNOWN_DEVICES.append((host, port)) + KNOWN_DEVICES.append(host) lms = LogitechMediaServer( host, port,