コード例 #1
0
def index():
    stats = {
        'currentTemp': 0,
        'currentHumidity': 0,
        'lastUpdateTime': "never",
        'message': "Not initialized",
        'targetTemp': 0,
        'brightness': 0
    }
    form = UpdateForm()
    q = RedisQueue('brooder')
    dataPoints = []
    for item in q.getall():
        dataPoints.append(json.loads(str(item, 'utf-8')))

    if len(dataPoints) > 0:
        stats = dataPoints[-1]

    brooderConfig = json.load(open(brooderConfigFile))
    return render_template('main.html', **locals())