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.
This commit is contained in:
Jan Harkes 2016-03-23 14:47:29 -04:00
parent 154d184247
commit 2d91dce6d0

View file

@ -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,