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.

18 lines
518 B

4 years ago
  1. """Discover Homekit devices."""
  2. from . import MDNSDiscoverable
  3. from ..const import ATTR_NAME
  4. class Discoverable(MDNSDiscoverable):
  5. """Add support for discovering HomeKit devices."""
  6. def __init__(self, nd):
  7. super(Discoverable, self).__init__(nd, '_hap._tcp.local.')
  8. def info_from_entry(self, entry):
  9. info = super(Discoverable, self).info_from_entry(entry)
  10. name = entry.name
  11. name = name.replace('._hap._tcp.local.', '')
  12. info[ATTR_NAME] = name
  13. return info