You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
547 B

4 years ago
  1. """Discover Apple TV media players."""
  2. from . import MDNSDiscoverable
  3. from ..const import ATTR_NAME, ATTR_PROPERTIES
  4. class Discoverable(MDNSDiscoverable):
  5. """Add support for Apple TV devices."""
  6. def __init__(self, nd):
  7. super(Discoverable, self).__init__(nd, '_appletv-v2._tcp.local.')
  8. def info_from_entry(self, entry):
  9. """Returns most important info from mDNS entries."""
  10. info = super().info_from_entry(entry)
  11. info[ATTR_NAME] = info[ATTR_PROPERTIES]['Name'].replace('\xa0', ' ')
  12. return info