Exemple #1
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)
Exemple #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)
Exemple #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)
 def turnOff(self, devId):
     resCode =  td.turnOff(devId)
     return self.getErrorString(resCode).lower()
Exemple #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)
Exemple #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: