mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-06 17:51:36 +00:00
16 lines
510 B
Python
16 lines
510 B
Python
"""Discover PlexMediaServer."""
|
|
from . import GDMDiscoverable
|
|
|
|
|
|
class Discoverable(GDMDiscoverable):
|
|
"""Add support for discovering Plex Media Server."""
|
|
|
|
def info_from_entry(self, entry):
|
|
"""Return most important info from a GDM entry."""
|
|
return (entry['data']['Name'],
|
|
'https://%s:%s' % (entry['from'][0], entry['data']['Port']))
|
|
|
|
def get_entries(self):
|
|
"""Return all PMS entries."""
|
|
return self.find_by_data({'Content-Type': 'plex/media-server'})
|