Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 56f7345

Browse files
cbulockballoob
authored andcommitted
Add Support for DirecTV Receivers (#39)
* add support for detecting DirecTV receivers * also return a unique identifier for the device
1 parent 42e7fce commit 56f7345

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

netdisco/discoverables/directv.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Discover DirecTV Receivers."""
2+
from netdisco.util import urlparse
3+
from . import SSDPDiscoverable
4+
5+
6+
class Discoverable(SSDPDiscoverable):
7+
"""Add support for discovering DirecTV Receivers."""
8+
9+
def info_from_entry(self, entry):
10+
"""Return the most important info from a uPnP entry."""
11+
url = urlparse(entry.values['location'])
12+
13+
device = entry.description['device']
14+
15+
return url.hostname, device['serialNumber']
16+
17+
def get_entries(self):
18+
"""Get all the DirecTV uPnP entries."""
19+
return self.find_by_device_description({
20+
"manufacturer": "DIRECTV",
21+
"deviceType": "urn:schemas-upnp-org:device:MediaServer:1"
22+
})

0 commit comments

Comments
 (0)