Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
def display_add_plant():
    content = init()
    content.update({'get': False, 'current_active': 'add plant'})

    return render_template('general/add.jade', content=content)
Exemplo n.º 5
0
def index():
  content = init()
  content.update({'error': request.args.get('error', '')})
  content.update({'current_active': 'overview'})
  return render_template('general/redirect.jade', content=content)
Exemplo n.º 6
0
def global_settings():
  content = init()
  content.update({'current_active': 'Global Settings', 'type': 'setting'})
  return render_template('general/settings.jade', content=content)
Exemplo n.º 7
0
def manage_plants():
  content = init()
  content.update({'get': True, 'current_active': 'manage plants'})
  return render_template('general/manage.jade', content=content)