예제 #1
0
파일: command.py 프로젝트: zpriddy/Firefly
def sendAppCommand(command):
  success = False
  for a in appsDB.find({'id':command.deviceID}):
    app = pickle.loads(a.get('ffObject'))
    app.sendCommand(command)
    appObj = pickle.dumps(app)
    appsDB.update_one({'id':app.id},{'$set': {'ffObject':appObj}, '$currentDate': {'lastModified': True}})
    success = True
  return success
예제 #2
0
def sendEventToApp(event):
    for a in appsDB.find({'listen': event.deviceID}):
        app = pickle.loads(a.get('ffObject'))
        app.sendEvent(event)
        appObj = pickle.dumps(app)
        appsDB.update_one({'id': app.id}, {
            '$set': {
                'ffObject': appObj
            },
            '$currentDate': {
                'lastModified': True
            }
        })
예제 #3
0
def sendAppCommand(command):
    success = False
    for a in appsDB.find({'id': command.deviceID}):
        app = pickle.loads(a.get('ffObject'))
        app.sendCommand(command)
        appObj = pickle.dumps(app)
        appsDB.update_one({'id': app.id}, {
            '$set': {
                'ffObject': appObj
            },
            '$currentDate': {
                'lastModified': True
            }
        })
        success = True
    return success
예제 #4
0
파일: event.py 프로젝트: zpriddy/Firefly
def sendEventToApp(event):
  for a in appsDB.find({'listen':event.deviceID}):
    app = pickle.loads(a.get('ffObject'))
    app.sendEvent(event)
    appObj = pickle.dumps(app)
    appsDB.update_one({'id':app.id},{'$set': {'ffObject':appObj}, '$currentDate': {'lastModified': True}})