Beispiel #1
0
def setData( deviceObj, dataTypeObj, data ):
    logger.debug("Setting Data")
    obj = Data(
        identifier = Authentication.generateIdentifier(
            [ deviceObj.identifier , dataTypeObj.identifier, data, time.time() ]
        ),
        device = deviceObj,
        datatype = dataTypeObj,
        value = data
    )

    obj.save()
    return obj
Beispiel #2
0
def setResponse( deviceObj , dataTypeObj , data ):

    logger.info("Creating Response Object")
    obj = Response(
        identifier = Authentication.generateIdentifier(
            [ deviceObj.identifier , dataTypeObj.identifier , time.time() ]
        ),
        device = deviceObj,
        datatype = dataTypeObj,
        value = data
    )

    obj.save()

    return obj