def toggle_406_power(): f406_status = read_mysql_database("led_status", "406_status") if f406_status: toggle_plug_power('406 Filter', 'off') update_mysql_database("led_status", "406_status", False) return redirect(url_for('tank_control')) else: toggle_plug_power('406 Filter', 'on') update_mysql_database("led_status", "406_status", True) return redirect(url_for('tank_control'))
def toggle_uv_pump_power(): uv_pump_status = read_mysql_database("led_status", "uv_pump_status") if uv_pump_status: toggle_plug_power('UV Light', 'off') update_mysql_database("led_status", "uv_pump_status", False) return redirect(url_for('tank_control')) else: toggle_plug_power('UV Light', 'on') update_mysql_database("led_status", "uv_pump_status", True) return redirect(url_for('tank_control'))
def toggle_airpump_power(): airpump_status = read_mysql_database("led_status", "airpump_status") if airpump_status: toggle_plug_power('Air Pump', 'off') update_mysql_database("led_status", "airpump_status", False) return redirect(url_for('tank_control')) else: toggle_plug_power('Air Pump', 'on') update_mysql_database("led_status", "airpump_status", True) return redirect(url_for('tank_control'))
def toggle_ph_controller_power(): ph_controller_status = read_mysql_database("led_status", "injecting_co2_led") if ph_controller_status: toggle_plug_power('PH Controller', 'off') update_mysql_database("led_status", "injecting_co2_led", False) return redirect(url_for('tank_control')) else: toggle_plug_power('PH Controller', 'on') update_mysql_database("led_status", "injecting_co2_led", True) return redirect(url_for('tank_control'))