summaryrefslogtreecommitdiff
path: root/netdisco/discoverables/apple_tv.py
diff options
context:
space:
mode:
Diffstat (limited to 'netdisco/discoverables/apple_tv.py')
-rw-r--r--netdisco/discoverables/apple_tv.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/netdisco/discoverables/apple_tv.py b/netdisco/discoverables/apple_tv.py
new file mode 100644
index 0000000..02cb642
--- /dev/null
+++ b/netdisco/discoverables/apple_tv.py
@@ -0,0 +1,16 @@
+"""Discover Apple TV media players."""
+from . import MDNSDiscoverable
+from ..const import ATTR_NAME, ATTR_PROPERTIES
+
+
+class Discoverable(MDNSDiscoverable):
+ """Add support for Apple TV devices."""
+
+ def __init__(self, nd):
+ super(Discoverable, self).__init__(nd, '_appletv-v2._tcp.local.')
+
+ def info_from_entry(self, entry):
+ """Returns most important info from mDNS entries."""
+ info = super().info_from_entry(entry)
+ info[ATTR_NAME] = info[ATTR_PROPERTIES]['Name'].replace('\xa0', ' ')
+ return info