mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-07 09:58:17 +00:00
Initial Configuration Push
This commit is contained in:
21
deps/netdisco/discoverables/sabnzbd.py
vendored
Normal file
21
deps/netdisco/discoverables/sabnzbd.py
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Discover SABnzbd servers."""
|
||||
from . import MDNSDiscoverable
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class Discoverable(MDNSDiscoverable):
|
||||
"""Add support for discovering SABnzbd."""
|
||||
|
||||
def __init__(self, nd):
|
||||
"""Initialize the SABnzbd discovery."""
|
||||
super(Discoverable, self).__init__(nd, '_http._tcp.local.')
|
||||
|
||||
def info_from_entry(self, entry):
|
||||
"""Return most important info from mDNS entries."""
|
||||
return (self.ip_from_host(entry.server), entry.port,
|
||||
entry.properties.get('path', '/sabnzbd/'))
|
||||
|
||||
def get_info(self):
|
||||
"""Get details of SABnzbd."""
|
||||
return [self.info_from_entry(entry) for entry in self.get_entries()
|
||||
if entry.name.startswith('SABnzbd on')]
|
||||
Reference in New Issue
Block a user