How to use the pywemo.ouimeaux_device.probe_wemo function in pywemo

To help you get started, we’ve selected a few pywemo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / homeassistant / components / wemo.py View on Github external
def setup_url_for_address(host, port):
        """Determine setup.xml url for given host and port pair."""
        if not port:
            port = pywemo.ouimeaux_device.probe_wemo(host)

        if not port:
            return None

        return 'http://{}:{}/setup.xml'.format(host, port)
github home-assistant / home-assistant / homeassistant / components / wemo / __init__.py View on Github external
def setup_url_for_address(host, port):
        """Determine setup.xml url for given host and port pair."""
        if not port:
            port = pywemo.ouimeaux_device.probe_wemo(host)

        if not port:
            return None

        return f"http://{host}:{port}/setup.xml"
github theyosh / TerrariumPI / terrariumSwitch.py View on Github external
def set_hardware_state(self, state, force = False):
    port = pywemo.ouimeaux_device.probe_wemo(self.get_address())
    device = pywemo.discovery.device_from_description(terrariumPowerSwitchWeMo.URL.format(self.get_address(), port), None)
    if state is terrariumPowerSwitch.ON:
      device.on()
    else:
      device.off()
github theyosh / TerrariumPI / terrariumSwitch.py View on Github external
def get_hardware_state(self):
    data = None
    try:
      port = pywemo.ouimeaux_device.probe_wemo(self.get_address())
      if port is not None:
        device = pywemo.discovery.device_from_description(terrariumPowerSwitchWeMo.URL.format(self.get_address(), port), None)
        data = device.get_state()

    except Exception as err:
      # Ignore for now
      print(err)

    return terrariumPowerSwitch.ON if terrariumUtils.is_true(data) else terrariumPowerSwitch.OFF