code: def by_name(name):
      
      devices = discover(all_households=True)
      for device in (devices or []):
          if device.player_name == name:
              return device
      return None
docs: Return a device by name.
  
      Args:
          name (str): The name of the device to return.
  
      Returns:
          :class:`~.SoCo`: The first device encountered among all zone with the
              given player name. If none are found `None` is returned.