Beispiel #1
0
def get(serial_number):
    res = controllerHandler.get_controllers(serial_number)
    if res:
        statusHandler.set_status_for_controllers(res)
        payload = {"controllers": res}
        return OkResponse(payload)
    else:
        return NotFoundResponse("Could not find any controllers for that installation and user")
Beispiel #2
0
def get_tags_by_type(serial_number, tag_type, controller_ip=None):
    res = None
    if controllerHandler.get_controllers(serial_number):
        if controller_ip:
            res = tag_dao.get_by_controller_and_type(serial_number, controller_ip, tag_type)
        else:
            res = tag_dao.get_by_installation_and_type(serial_number, tag_type)
    return res