How to use the pywemo.ouimeaux_device.motion.Motion 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 pavoni / pywemo / pywemo / upnp.py View on Github external
def device_from_uuid_and_location(uuid, location):
    """ Tries to determine which device it is based on the uuid. """
    if uuid.startswith('uuid:Socket'):
        return Switch(location)
    elif uuid.startswith('uuid:Lightswitch'):
        return LightSwitch(location)
    elif uuid.startswith('uuid:Insight'):
        return Insight(location)
    elif uuid.startswith('uuid:Sensor'):
        return Motion(location)
    else:
        return None
github pavoni / pywemo / pywemo / discovery.py View on Github external
if uuid is None:
        return None
    if uuid.startswith('uuid:Socket'):
        return Switch(url=location, mac=mac,
                      rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Lightswitch'):
        return LightSwitch(url=location, mac=mac,
                           rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Dimmer'):
        return Dimmer(url=location, mac=mac,
                      rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Insight'):
        return Insight(url=location, mac=mac,
                       rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Sensor'):
        return Motion(url=location, mac=mac,
                      rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Maker'):
        return Maker(url=location, mac=mac,
                     rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Bridge'):
        return Bridge(url=location, mac=mac,
                      rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:CoffeeMaker'):
        return CoffeeMaker(url=location, mac=mac,
                           rediscovery_enabled=rediscovery_enabled)
    if uuid.startswith('uuid:Humidifier'):
        return Humidifier(url=location, mac=mac,
                          rediscovery_enabled=rediscovery_enabled)

    return None