How to use the fauxmo.dummy_handler function in fauxmo

To help you get started, we’ve selected a few fauxmo 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 toddmedema / echo / fauxmo.py View on Github external
def __init__(self, on_cmd, off_cmd):
        self.on_cmd = on_cmd
        self.off_cmd = off_cmd

    def on(self):
        r = requests.get(self.on_cmd)
        return r.status_code == 200

    def off(self):
        r = requests.get(self.off_cmd)
        return r.status_code == 200

if __name__ == "__main__":
    FAUXMOS = [
        ['office lights', dummy_handler("officelight")],
        ['kitchen lights', dummy_handler("kitchenlight")],
    ]

    if len(sys.argv) > 1 and sys.argv[1] == '-d':
        DEBUG = True

    # Set up our singleton for polling the sockets for data ready
    p = poller()

    # Set up our singleton listener for UPnP broadcasts
    u = upnp_broadcast_responder()
    u.init_socket()

    # Add the UPnP broadcast listener to the poller so we can respond
    # when a broadcast is received.
    p.add(u)
github toddmedema / echo / fauxmo.py View on Github external
class rest_api_handler(object):
    def __init__(self, on_cmd, off_cmd):
        self.on_cmd = on_cmd
        self.off_cmd = off_cmd

    def on(self):
        r = requests.get(self.on_cmd)
        return r.status_code == 200

    def off(self):
        r = requests.get(self.off_cmd)
        return r.status_code == 200

if __name__ == "__main__":
    FAUXMOS = [
        ['office lights', dummy_handler("officelight")],
        ['kitchen lights', dummy_handler("kitchenlight")],
    ]

    if len(sys.argv) > 1 and sys.argv[1] == '-d':
        DEBUG = True

    # Set up our singleton for polling the sockets for data ready
    p = poller()

    # Set up our singleton listener for UPnP broadcasts
    u = upnp_broadcast_responder()
    u.init_socket()

    # Add the UPnP broadcast listener to the poller so we can respond
    # when a broadcast is received.
    p.add(u)
github nassir-malik / IOT-Pi3-Alexa-Automation / fauxmo.py View on Github external
class rest_api_handler(object):
    def __init__(self, on_cmd, off_cmd):
        self.on_cmd = on_cmd
        self.off_cmd = off_cmd

    def on(self):
        r = requests.get(self.on_cmd)
        return r.status_code == 200

    def off(self):
        r = requests.get(self.off_cmd)
        return r.status_code == 200

if __name__ == "__main__":
    FAUXMOS = [
        ['office lights', dummy_handler("officelight")],
        ['kitchen lights', dummy_handler("kitchenlight")],
    ]

    if len(sys.argv) > 1 and sys.argv[1] == '-d':
        DEBUG = True

    # Set up our singleton for polling the sockets for data ready
    p = poller()

    # Set up our singleton listener for UPnP broadcasts
    u = upnp_broadcast_responder()
    u.init_socket()

    # Add the UPnP broadcast listener to the poller so we can respond
    # when a broadcast is received.
    p.add(u)
github nassir-malik / IOT-Pi3-Alexa-Automation / fauxmo.py View on Github external
def __init__(self, on_cmd, off_cmd):
        self.on_cmd = on_cmd
        self.off_cmd = off_cmd

    def on(self):
        r = requests.get(self.on_cmd)
        return r.status_code == 200

    def off(self):
        r = requests.get(self.off_cmd)
        return r.status_code == 200

if __name__ == "__main__":
    FAUXMOS = [
        ['office lights', dummy_handler("officelight")],
        ['kitchen lights', dummy_handler("kitchenlight")],
    ]

    if len(sys.argv) > 1 and sys.argv[1] == '-d':
        DEBUG = True

    # Set up our singleton for polling the sockets for data ready
    p = poller()

    # Set up our singleton listener for UPnP broadcasts
    u = upnp_broadcast_responder()
    u.init_socket()

    # Add the UPnP broadcast listener to the poller so we can respond
    # when a broadcast is received.
    p.add(u)