summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2019-10-18 22:42:31 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2019-10-18 22:42:31 +0200
commit376d84749dcdcd648a1cbb58e5ea3a6e19b96c12 (patch)
treed2105530b8c09e9a593b5ac816dfd2a45b76db4a
parent51314ba9981cf74f773880dccb194cfeb41cb62f (diff)
parent597fa780323380ec0bd48049f4224e94d3254056 (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.py12
-rw-r--r--netdisco/discoverables/enigma2.py10
-rw-r--r--netdisco/discoverables/hass_mobile_app.py9
-rw-r--r--netdisco/discoverables/heos.py10
-rw-r--r--netdisco/discoverables/hikvision.py13
-rw-r--r--netdisco/discoverables/openhome.py3
-rw-r--r--netdisco/discoverables/sercomm.py15
-rw-r--r--netdisco/discoverables/songpal.py21
-rw-r--r--setup.py2
-rw-r--r--tox.ini2
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.."""
diff --git a/setup.py b/setup.py
index 7fe1e70..a7f4364 100644
--- a/setup.py
+++ b/setup.py
@@ -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',
diff --git a/tox.ini b/tox.ini
index 714a850..eb5c507 100644
--- a/tox.ini
+++ b/tox.ini
@@ -21,6 +21,6 @@ commands =
[testenv:typing]
deps =
- mypy>=0.650
+ mypy==0.650
commands =
mypy netdisco tests setup.py example_service.py