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.

19 lines
665 B

4 years ago
  1. """Discover Belkin Wemo devices."""
  2. from . import SSDPDiscoverable
  3. from ..const import ATTR_MAC_ADDRESS
  4. class Discoverable(SSDPDiscoverable):
  5. """Add support for discovering Belkin WeMo platform devices."""
  6. def info_from_entry(self, entry):
  7. """Return most important info from a uPnP entry."""
  8. info = super().info_from_entry(entry)
  9. device = entry.description['device']
  10. info[ATTR_MAC_ADDRESS] = device.get('macAddress', '')
  11. return info
  12. def get_entries(self):
  13. """Return all Belkin Wemo entries."""
  14. return self.find_by_device_description(
  15. {'manufacturer': 'Belkin International Inc.'})