Esempio n. 1
0
 def __call__(self, device, deviceValue, deviceName):
     if deviceValue == 0:
         powered = "False"
     else:
         powered = "True"
     self.adress = 'http://' + self.plugin.host + '/zwave/setDeviceState?NODEID=' + device + '&Powered=' + powered + '&Level=' + str(
         deviceValue) + '&Password=' + self.plugin.password
     r = self.plugin.getCmd(self.adress)
     eg.StopMacro(ignoreReturn=False)
Esempio n. 2
0
 def __call__(self, scene):
     url = 'http://' + self.plugin.host + '/zwave/activateScene'
     payload = {
         "password": self.plugin.password,
         "sceneName": scene,
         "activate": 1
     }
     send = self.plugin.putCmd(url, payload)
     eg.StopMacro(ignoreReturn=True)
Esempio n. 3
0
    def __call__(self, device, deviceName):
        url = 'http://' + self.plugin.host + '/zwave/setDevicePower'
        payload = {
            "password": self.plugin.password,
            "deviceId": device,
            "powered": "false"
        }

        send = self.plugin.putCmd(url, payload)
        eg.StopMacro(ignoreReturn=True)
Esempio n. 4
0
    def __call__(self, device, deviceName):
        url = 'http://' + self.plugin.host + '/zwave/setDevicePower'
        cmd = self.plugin.getDevices()

        state = self.plugin.outletdict[deviceName]['value']
        if state == "255":
            powered = "false"
        else:
            powered = "true"

        payload = {
            "password": self.plugin.password,
            "deviceId": device,
            "powered": powered
        }

        send = self.plugin.putCmd(url, payload)
        eg.StopMacro(ignoreReturn=True)