mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix Plex component to use port number in discovery. (#8197)
* Fix Plex component to use port number in discovery. * Break line * Correctly save port to config * Handle port with fewer code changes * This is stuck configuring and I'm not sure why * Changes suggested by @dale3h
This commit is contained in:
parent
2dd7f0616e
commit
f02d169864
@ -88,6 +88,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
elif discovery_info is not None:
|
||||
# Parse discovery data
|
||||
host = discovery_info.get('host')
|
||||
port = discovery_info.get('port')
|
||||
host = '%s:%s' % (host, port)
|
||||
_LOGGER.info("Discovered PLEX server: %s", host)
|
||||
|
||||
if host in _CONFIGURING:
|
||||
@ -106,6 +108,7 @@ def setup_plexserver(host, token, hass, config, add_devices_callback):
|
||||
|
||||
try:
|
||||
plexserver = plexapi.server.PlexServer('http://%s' % host, token)
|
||||
_LOGGER.info("Discovery configuration done (no token needed)")
|
||||
except (plexapi.exceptions.BadRequest, plexapi.exceptions.Unauthorized,
|
||||
plexapi.exceptions.NotFound) as error:
|
||||
_LOGGER.info(error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user