예제 #1
0
파일: __init__.py 프로젝트: auduny/chains
 def action_off(self, id):
     '''
     Turn a lamp off
     @param  id     int   ID of device in tellstick.conf
     '''
     id = self.parseId(id)
     td.turnOff(id)
     self.deviceEventCallback(id, td.TELLSTICK_TURNOFF, self.minLampValue, 1)
예제 #2
0
 def action_off(self, id):
     '''
     Turn a lamp off
     @param  id     int   ID of device in tellstick.conf
     '''
     id = self.parseId(id)
     td.turnOff(id)
     self.deviceEventCallback(id, td.TELLSTICK_TURNOFF, self.minLampValue,
                              1)
예제 #3
0
def SendOff(device):

    deviceId, deviceName = getDeviceIdAndName(device)
    resCode = td.turnOff(deviceId)
    if resCode != 0:
        res = td.getErrorString(resCode)
    else:
        res = 'Success'
    print('Turning off device:', deviceId, deviceName, '-', res)
예제 #4
0
 def turnOff(self, devId):
     resCode =  td.turnOff(devId)
     return self.getErrorString(resCode).lower()
예제 #5
0
        print 'Turning on device:', deviceId, deviceName, '-', res



    elif options.on == None and options.off != None and options.bell == None and options.list == False and options.dim == None and options.learn == None and options.event == False:

        #
        #   OFF
        #
                    
        deviceId, deviceName = getDeviceIdAndName(options.off)
        
        if deviceId == -1:
            parser.error('unknown device: ' + options.off) 

        resCode = td.turnOff(deviceId)
        if resCode != 0:
            res = td.getErrorString(resCode)
        else:
            res = 'Success'

        print 'Turning off device:', deviceId, deviceName, '-', res


    elif options.on == None and options.off == None and options.bell != None and options.list == False and options.dim == None and options.learn == None and options.event == False:

        #
        #   BELL
        #
                    
        deviceId, deviceName = getDeviceIdAndName(options.bell)
예제 #6
0
            res = 'Success'

        print 'Turning on device:', deviceId, deviceName, '-', res

    elif options.on == None and options.off != None and options.bell == None and options.list == False and options.dim == None and options.learn == None and options.event == False:

        #
        #   OFF
        #

        deviceId, deviceName = getDeviceIdAndName(options.off)

        if deviceId == -1:
            parser.error('unknown device: ' + options.off)

        resCode = td.turnOff(deviceId)
        if resCode != 0:
            res = td.getErrorString(resCode)
        else:
            res = 'Success'

        print 'Turning off device:', deviceId, deviceName, '-', res

    elif options.on == None and options.off == None and options.bell != None and options.list == False and options.dim == None and options.learn == None and options.event == False:

        #
        #   BELL
        #

        deviceId, deviceName = getDeviceIdAndName(options.bell)
        if deviceId == -1: