diff options
author | Ruben Undheim <ruben.undheim@gmail.com> | 2019-10-18 22:42:31 +0200 |
---|---|---|
committer | Ruben Undheim <ruben.undheim@gmail.com> | 2019-10-18 22:42:31 +0200 |
commit | 376d84749dcdcd648a1cbb58e5ea3a6e19b96c12 (patch) | |
tree | d2105530b8c09e9a593b5ac816dfd2a45b76db4a | |
parent | 51314ba9981cf74f773880dccb194cfeb41cb62f (diff) | |
parent | 597fa780323380ec0bd48049f4224e94d3254056 (diff) |
Update upstream source from tag 'upstream/2.6.0'
Update to upstream version '2.6.0'
with Debian dir 4224b9fe7338cb812a784ba81c9f778d26bc3e91
-rw-r--r-- | netdisco/discoverables/digitalstrom.py | 12 | ||||
-rw-r--r-- | netdisco/discoverables/enigma2.py | 10 | ||||
-rw-r--r-- | netdisco/discoverables/hass_mobile_app.py | 9 | ||||
-rw-r--r-- | netdisco/discoverables/heos.py | 10 | ||||
-rw-r--r-- | netdisco/discoverables/hikvision.py | 13 | ||||
-rw-r--r-- | netdisco/discoverables/openhome.py | 3 | ||||
-rw-r--r-- | netdisco/discoverables/sercomm.py | 15 | ||||
-rw-r--r-- | netdisco/discoverables/songpal.py | 21 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
10 files changed, 87 insertions, 10 deletions
diff --git a/netdisco/discoverables/digitalstrom.py b/netdisco/discoverables/digitalstrom.py new file mode 100644 index 0000000..ef1973a --- /dev/null +++ b/netdisco/discoverables/digitalstrom.py @@ -0,0 +1,12 @@ +"""Discover digitalSTROM server IP (dss-ip) devices.""" +from . import MDNSDiscoverable + + +class Discoverable(MDNSDiscoverable): + """Add support for discovering digitalSTROM server IP (dss-ip) devices.""" + + def __init__(self, nd): + super(Discoverable, self).__init__(nd, '_http._tcp.local.') + + def get_entries(self): + return self.find_by_device_name('dss-ip') diff --git a/netdisco/discoverables/enigma2.py b/netdisco/discoverables/enigma2.py new file mode 100644 index 0000000..17ee34a --- /dev/null +++ b/netdisco/discoverables/enigma2.py @@ -0,0 +1,10 @@ +"""Discover Enigma2 servers.""" +from . import MDNSDiscoverable + + +class Discoverable(MDNSDiscoverable): + """Add support for discovering Enigma2 boxes.""" + + def __init__(self, nd): + """Initialize the Enigma2 discovery.""" + super(Discoverable, self).__init__(nd, '_e2stream._tcp.local.') diff --git a/netdisco/discoverables/hass_mobile_app.py b/netdisco/discoverables/hass_mobile_app.py new file mode 100644 index 0000000..9d2c7cf --- /dev/null +++ b/netdisco/discoverables/hass_mobile_app.py @@ -0,0 +1,9 @@ +"""Discover Home Assistant servers.""" +from . import MDNSDiscoverable + + +class Discoverable(MDNSDiscoverable): + """Add support for discovering mobile apps that support Home Assistant.""" + + def __init__(self, nd): + super(Discoverable, self).__init__(nd, '_hass-mobile-app._tcp.local.') diff --git a/netdisco/discoverables/heos.py b/netdisco/discoverables/heos.py new file mode 100644 index 0000000..5b6aa14 --- /dev/null +++ b/netdisco/discoverables/heos.py @@ -0,0 +1,10 @@ +"""Discover Heos devices.""" +from . import SSDPDiscoverable + + +class Discoverable(SSDPDiscoverable): + """Add support for discovering DLNA services.""" + + def get_entries(self): + """Get all the HEOS devices.""" + return self.find_by_st("urn:schemas-denon-com:device:ACT-Denon:1") diff --git a/netdisco/discoverables/hikvision.py b/netdisco/discoverables/hikvision.py new file mode 100644 index 0000000..cf9372e --- /dev/null +++ b/netdisco/discoverables/hikvision.py @@ -0,0 +1,13 @@ +"""Discover Hikvision cameras.""" +from . import MDNSDiscoverable + + +class Discoverable(MDNSDiscoverable): + """Add support for discovering Hikvision cameras.""" + + def __init__(self, nd): + """Initialize Hikvision camera discovery.""" + super(Discoverable, self).__init__(nd, '_http._tcp.local.') + + def get_entries(self): + return self.find_by_device_name('HIKVISION') diff --git a/netdisco/discoverables/openhome.py b/netdisco/discoverables/openhome.py index 7adca6f..5374964 100644 --- a/netdisco/discoverables/openhome.py +++ b/netdisco/discoverables/openhome.py @@ -7,5 +7,6 @@ class Discoverable(SSDPDiscoverable): def get_entries(self): """Get all the Openhome compliant device uPnP entries.""" - return self.find_by_st("urn:av-openhome-org:service:Product:2") + \ + return self.find_by_st("urn:av-openhome-org:service:Product:1") + \ + self.find_by_st("urn:av-openhome-org:service:Product:2") + \ self.find_by_st("urn:av-openhome-org:service:Product:3") diff --git a/netdisco/discoverables/sercomm.py b/netdisco/discoverables/sercomm.py new file mode 100644 index 0000000..870e34a --- /dev/null +++ b/netdisco/discoverables/sercomm.py @@ -0,0 +1,15 @@ +""" +Discover Sercomm network cameras. +These are rebranded as iControl and many others, and are usually +distributed as part of an ADT or Comcast/Xfinity monitoring package. +https://github.com/edent/Sercomm-API +""" +from . import SSDPDiscoverable + + +class Discoverable(SSDPDiscoverable): + """Add support for discovering camera services.""" + + def get_entries(self): + """Get all Sercomm iControl devices.""" + return self.find_by_device_description({'manufacturer': 'iControl'}) diff --git a/netdisco/discoverables/songpal.py b/netdisco/discoverables/songpal.py index 94d09d6..5eafe32 100644 --- a/netdisco/discoverables/songpal.py +++ b/netdisco/discoverables/songpal.py @@ -13,17 +13,24 @@ class Discoverable(SSDPDiscoverable): devs = self.find_by_st( "urn:schemas-sony-com:service:ScalarWebAPI:1") - # At least some Bravia televisions use this API for communication. - # Based on some examples they always seem to lack modelNumber, - # so we use it here to keep them undiscovered for now. - non_bravias = [] + # At least some Bravia televisions use the same API for communication, + # but are handled by another platforms, so we filter them out here. + supported = [] for dev in devs: if 'device' in dev.description: device = dev.description['device'] - if 'modelNumber' in device: - non_bravias.append(dev) + scalarweb_info = device.get("X_ScalarWebAPI_DeviceInfo", None) - return non_bravias + if scalarweb_info: + services = scalarweb_info["X_ScalarWebAPI_ServiceList"] + service_types = services["X_ScalarWebAPI_ServiceType"] + # Sony Bravias offer videoScreen service, soundbars do not + if 'videoScreen' in service_types: + continue + + supported.append(dev) + + return supported def info_from_entry(self, entry): """Get information for a device..""" @@ -9,7 +9,7 @@ with open(os.path.join(here, 'README.md'), encoding='utf-8') as readme_file: setup( name='netdisco', - version='2.3.0', + version='2.6.0', description='Discover devices on your local network', long_description=long_description, long_description_content_type='text/markdown', @@ -21,6 +21,6 @@ commands = [testenv:typing] deps = - mypy>=0.650 + mypy==0.650 commands = mypy netdisco tests setup.py example_service.py |