Skip to content
Snippets Groups Projects
Commit 334a54ba authored by Adrien Chabod's avatar Adrien Chabod
Browse files

requete de commande

parent 6bef59bb
No related branches found
No related tags found
1 merge request!1MAJ BDD + Data commande fonctionnel
......@@ -43,4 +43,9 @@ def gpioSetup():
GPIO.setup(gpioDebitmetre2, GPIO.IN)
GPIO.setup(gpioDebitmetre3, GPIO.IN)
def
\ No newline at end of file
def main(commande: tuple):
increment = 0
for k in commande:
if k >= increment:
GPIO.output()
\ No newline at end of file
......@@ -90,6 +90,16 @@ def mysql_maj_machine(maj: tuple):
cursor.close()
connection.close()
def mysql_get_composition_for_machine(commande: tuple):
connection = connect_db()
cursor = connection.cursor()
for k in commande:
cursor.execute("SELECT id_bec, quantite FROM ingredient INNER JOIN machine ON ingredient.id_bec = machine.id_bec WHERE ingredient.id_ingredient = %s", (k,))
data = data + cursor.fetchall()
cursor.close()
connection.close()
return data
def formalize_data_list(function):
initial_data = function()
new_data = "/".join([",".join([str(k) for k in x]) for x in initial_data])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment