Esempio n. 1
0
def assignFunctionToMotion():
    motionName = request.args.get('motionName')
    functionName = request.args.get('functionName')

    motionManager = MotionManager()

    motion = motionManager.getMotion(motionName)
    function = getattr(motion.getAssignedDevice(), functionName)

    motion.assignFunction(function)
    motionManager.updateMotion(motion)

    return 'True'
Esempio n. 2
0
def assignDeviceToMotion():
    motionName = request.args.get('motionName')
    deviceName = request.args.get('deviceName')

    motionManager = MotionManager()
    deviceManager = DeviceManager()

    motion = motionManager.getMotion(motionName)
    device = deviceManager.getDevice(deviceName)

    motion.assignDevice(device)
    motionManager.updateMotion(motion)

    return 'True'