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/")
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()
def add_sensor(): return render_template("sensor/add.html", modules = ModuleInteractor.get_all() )