def overview(plant): session['plant'] = plant set_uuid() content = init() content.update(init_overview()) content.update({'current': 'overview', 'get': True, 'current_active': plant, 'type': 'plant'}) return render_template('plant/overview.jade', content=content)
def sensorData(plant, sensor): session['plant'] = plant session['sensor'] = sensor set_uuid() content = init() content.update(init_sensor()) content.update({'current': sensor, 'get': True, 'current_active': plant, 'type': 'plant', 'random': random}) return render_template('plant/sensor.jade', content=content)
def plantSettings(plant): session['plant'] = plant set_uuid() query = urllib.parse.urlencode({'select': 'intervals'}) with urllib.request.urlopen('http://localhost:2902/plants/{}?{}'.format(session['p_uuid'], query)) as response: intervals = json.loads(response.read().decode('utf8'))['content'] content = init() content['intervals'] = intervals content.update({'current': 'plant_settings', 'get': True, 'current_active': plant, 'type': 'plant'}) return render_template('plant/settings.jade', content=content)
def display_add_plant(): content = init() content.update({'get': False, 'current_active': 'add plant'}) return render_template('general/add.jade', content=content)
def index(): content = init() content.update({'error': request.args.get('error', '')}) content.update({'current_active': 'overview'}) return render_template('general/redirect.jade', content=content)
def global_settings(): content = init() content.update({'current_active': 'Global Settings', 'type': 'setting'}) return render_template('general/settings.jade', content=content)
def manage_plants(): content = init() content.update({'get': True, 'current_active': 'manage plants'}) return render_template('general/manage.jade', content=content)