Esempio n. 1
0
def edit_sensor(sensor_id):
    sensor = SensorInteractor.get(sensor_id)
    if sensor:
        return render_template("/sensor/add.html", sensor = sensor, modules = ModuleInteractor.get_all() )

    flash("Sensor doesn't exist!", category={ 'theme': 'error' } )
    app.logger.error("Sensor editing view: Sensor doesn't exist")
    return redirect("/sensors/")
Esempio n. 2
0
def get_pins_for_module(module_id):
    pins = ModuleInteractor.get_pins(module_id)
    if pins:
        return render_template("/common/pin_select.html", pins = pins)
    return make_response()
Esempio n. 3
0
def add_sensor():
    return render_template("sensor/add.html", modules = ModuleInteractor.get_all() )