Ejemplo n.º 1
0
 def action_on(self, id):
     '''
     Turn a lamp on
     @param  id     int   ID of device in tellstick.conf
     '''
     id = self.parseId(id)
     td.turnOn(id)
     self.deviceEventCallback(id, td.TELLSTICK_TURNON, self.maxLampValue, 1)
Ejemplo n.º 2
0
 def action_on(self, id):
     '''
     Turn a lamp on
     @param  id     int   ID of device in tellstick.conf
     '''
     id = self.parseId(id)
     td.turnOn(id)
     self.deviceEventCallback(id, td.TELLSTICK_TURNON, self.maxLampValue, 1)
Ejemplo n.º 3
0
def SendOn(device):
    deviceId, deviceName = getDeviceIdAndName(device)
    resCode = td.turnOn(deviceId)
    if resCode != 0:
        res = td.getErrorString(resCode)
    else:
        res = 'Success'
    print('Turning on device:', deviceId, deviceName, '-', res)
Ejemplo n.º 4
0
 def turnOn(self, devId):
     resCode = td.turnOn(devId)
     return self.getErrorString(resCode).lower()
Ejemplo n.º 5
0
    (options, args) = parser.parse_args()

    td.init( defaultMethods = td.TELLSTICK_TURNON | td.TELLSTICK_TURNOFF ) #Application can configure to support different methods
#    td.init()

    if 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:

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

        resCode = td.turnOn(deviceId)
        if resCode != 0:
            res = td.getErrorString(resCode)
        else:
            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
        #
                    
Ejemplo n.º 6
0
    td.init(defaultMethods=td.TELLSTICK_TURNON | td.TELLSTICK_TURNOFF
            )  #Application can configure to support different methods
    #    td.init()

    if 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:

        #
        #   ON
        #

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

        resCode = td.turnOn(deviceId)
        if resCode != 0:
            res = td.getErrorString(resCode)
        else:
            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)