def sensors_get(sensor_type=[]):
    """ method to get sensors by type """
    resultlist = []

    items=[]
    if sensor_type:
        items = Sensor.scan(type__contains=sensor_type)            
    else:
        items = Sensor.scan()          
    for item in items:
        resultlist.append(item.attribute_values)
    return resultlist
def sensors_delete(sensor_type=[]):
    """ method to delete sensors by type """
    resultlist = []

    items=[]
    if sensor_type:
       items = Sensor.scan(type__contains=sensor_type)
    else:
       items = Sensor.scan()
    for item in items:
        resultlist.append(item.delete())
    return "%s items deleted." % len(resultlist)
def buildings_building_id_sensors_get(buildingId, room=[], type=[]):
    """ method to get sensors using building id """
    resultlist = []
    items = []
    if room and type:
       items = Sensor.scan(buildingId__eq=buildingId,room__eq=room,type__eq=type)
    elif room:
       items = Sensor.scan(buildingId__eq=buildingId,room__eq=room)
    elif type:
       items = Sensor.scan(buildingId__eq=buildingId,type__eq=type)
    else:
       items = Sensor.scan(buildingId__eq=buildingId)
    for item in items:
        resultlist.append(item.attribute_values)
    return resultlist
示例#4
0
def buildings_building_id_sensors_get(buildingId, room=[], type=[]):
    """ method to get sensors using building id """
    resultlist = []
    items = []
    if room and type:
        items = Sensor.scan(buildingId__eq=buildingId,
                            room__eq=room,
                            type__eq=type)
    elif room:
        items = Sensor.scan(buildingId__eq=buildingId, room__eq=room)
    elif type:
        items = Sensor.scan(buildingId__eq=buildingId, type__eq=type)
    else:
        items = Sensor.scan(buildingId__eq=buildingId)
    for item in items:
        resultlist.append(item.attribute_values)
    return resultlist
示例#5
0
def sensors_get() -> str:
    resultList = []
    for item in Sensor.scan():
        resultList.append(item.attribute_values)
    return resultList
示例#6
0
def sensors_delete() -> str:
    temp = []
    for item in Sensor.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
def buildings_building_id_sensors_delete(buildingId):
    """ method to delete sensor using building id """
    resultlist = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultlist.append(item.delete())
    return "%s items deleted." % len(resultlist)
示例#8
0
def sensors_get() -> str:
    resultList = []
    for item in Sensor.scan():
        resultList.append(item.attribute_values)
    return resultList
示例#9
0
def sensors_delete():
    """ method to delete sensor """
    temp = []
    for item in Sensor.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#10
0
def sensors_get():
    """ method to get all sensors """
    resultlist = []
    for item in Sensor.scan():
        resultlist.append(item.attribute_values)
    return resultlist
示例#11
0
def buildings_building_id_sensors_delete(buildingId):
    """ method to delete sensor using building id """
    resultlist = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultlist.append(item.delete())
    return "%s items deleted." % len(resultlist)
示例#12
0
def sensors_delete():
    """ method to delete sensor """
    temp = []
    for item in Sensor.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#13
0
def buildings_building_id_sensors_get(buildingId) -> str:
    resultList = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultList.append(item.attribute_values)
    return (resultList)
示例#14
0
def buildings_building_id_sensors_delete(buildingId) -> str:
    resultList = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultList.append(item.delete())
    return "%s items deleted." % len(resultList)
示例#15
0
def buildings_building_id_sensors_delete(buildingId) -> str:
    resultList = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultList.append(item.delete())
    return "%s items deleted." % len(resultList)
示例#16
0
def sensors_get():
    """ method to get all sensors """
    resultlist = []
    for item in Sensor.scan():
        resultlist.append(item.attribute_values)
    return resultlist
示例#17
0
def buildings_building_id_sensors_get(buildingId) -> str:
    resultList = []
    for item in Sensor.scan(buildingId__eq=buildingId):
        resultList.append(item.attribute_values)
    return ( resultList )
示例#18
0
def sensors_delete() -> str:
    temp = []
    for item in Sensor.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)