""" Discovers Belkin Wemo devices. """

from . import SSDPDiscoverable


class Discoverable(SSDPDiscoverable):
    """ Adds support for discovering Belkin WeMo platform devices. """

    def info_from_entry(self, entry):
        """ Returns most important info from a uPnP entry. """
        device = entry.description['device']

        return (device['friendlyName'], device['modelName'],
                entry.values['location'], device.get('macAddress', ''))

    def get_entries(self):
        """ Returns all Belkin Wemo entries. """
        return self.find_by_device_description(
            {'manufacturer': 'Belkin International Inc.'})

""" Discovers Belkin Wemo devices. """

from . import SSDPDiscoverable


class Discoverable(SSDPDiscoverable):
    """ Adds support for discovering Belkin WeMo platform devices. """

    def info_from_entry(self, entry):
        """ Returns most important info from a uPnP entry. """
        device = entry.description['device']

        return (device['friendlyName'], device['modelName'],
                entry.values['location'], device.get('macAddress', ''),
                device['serialNumber'])

    def get_entries(self):
        """ Returns all Belkin Wemo entries. """
        return self.find_by_device_description(
            {'manufacturer': 'Belkin International Inc.'})

Add serialnumber to wemo discovery info tuple
Add serialnumber to wemo discovery info tuple

  """ Discovers Belkin Wemo devices. """
  
  from . import SSDPDiscoverable
  
  
  class Discoverable(SSDPDiscoverable):
      """ Adds support for discovering Belkin WeMo platform devices. """
  
      def info_from_entry(self, entry):
          """ Returns most important info from a uPnP entry. """
          device = entry.description['device']
  
          return (device['friendlyName'], device['modelName'],
-                 entry.values['location'], device.get('macAddress', ''))
+                 entry.values['location'], device.get('macAddress', ''),
+                 device['serialNumber'])
  
      def get_entries(self):
          """ Returns all Belkin Wemo entries. """
          return self.find_by_device_description(
              {'manufacturer': 'Belkin International Inc.'})
  
Add serialnumber to wemo discovery info tuple
## Code Before:
""" Discovers Belkin Wemo devices. """

from . import SSDPDiscoverable


class Discoverable(SSDPDiscoverable):
    """ Adds support for discovering Belkin WeMo platform devices. """

    def info_from_entry(self, entry):
        """ Returns most important info from a uPnP entry. """
        device = entry.description['device']

        return (device['friendlyName'], device['modelName'],
                entry.values['location'], device.get('macAddress', ''))

    def get_entries(self):
        """ Returns all Belkin Wemo entries. """
        return self.find_by_device_description(
            {'manufacturer': 'Belkin International Inc.'})

## Instruction:
Add serialnumber to wemo discovery info tuple
## Code After:
""" Discovers Belkin Wemo devices. """

from . import SSDPDiscoverable


class Discoverable(SSDPDiscoverable):
    """ Adds support for discovering Belkin WeMo platform devices. """

    def info_from_entry(self, entry):
        """ Returns most important info from a uPnP entry. """
        device = entry.description['device']

        return (device['friendlyName'], device['modelName'],
                entry.values['location'], device.get('macAddress', ''),
                device['serialNumber'])

    def get_entries(self):
        """ Returns all Belkin Wemo entries. """
        return self.find_by_device_description(
            {'manufacturer': 'Belkin International Inc.'})
