Beispiel #1
0
def fire_value():
    if request.method == 'GET':
        fire_value = Settings.get_fire_value()
        return jsonify({'status':'ok', 'fire_value': fire_value})
    elif request.method == 'POST':
        fire_value = request.form.get('fire_value')
        if fire_value:
            fire_value = float(fire_value)
            Settings.set_fire_value(fire_value)
        return jsonify({'status': 'ok', 'fire_value': fire_value})
Beispiel #2
0
def load_settings():
    settings = {}

    fire_value = None
    try:
        fire_value = Settings.get_fire_value()
    except:
        pass
    settings['fire_value'] = fire_value

    should_alarm = False
    try:
        should_alarm = Settings.get_alert_switch_value()
    except:
        pass
    settings['should_alarm'] = should_alarm

    dev_port = app.config.get('DEV_PORT')
    if dev_port:
        settings['dev_port'] = dev_port

    app.logger.info(settings)
    return settings
Beispiel #3
0
def settings():
    users = Notification.get_all_recievers()
    fire_value = Settings.get_fire_value()
    alert = Settings.get_alert_switch_value()
    return render_template('settings.html', users=users, fire_value=fire_value, alert=alert)