kleine Korrekturen
This commit is contained in:
parent
b0792a6635
commit
3ce4c42bc0
|
@ -32,6 +32,7 @@ def insert_data(temp, sensor_id, config):
|
|||
cnx.commit()
|
||||
cursor.close()
|
||||
cnx.close()
|
||||
print(f"Daten erfolgreich eingefügt in: {config["host"]}")
|
||||
except mysql.connector.Error as err:
|
||||
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
|
||||
print("Etwas ist mit deinem Benutzernamen oder Passwort falsch.")
|
||||
|
@ -39,11 +40,12 @@ def insert_data(temp, sensor_id, config):
|
|||
print("Die Datenbank existiert nicht.")
|
||||
else:
|
||||
print(err)
|
||||
else:
|
||||
print("Daten erfolgreich eingefügt.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
insert_data(get_temp(0x09), 1, config_cloud)
|
||||
insert_data(get_temp(0x0a), 2, config_cloud)
|
||||
#insert_data(get_temp(0x0b), 3)
|
||||
insert_data(get_temp(0x0b), 3, config_cloud)
|
||||
insert_data(get_temp(0x09), 1, config_local)
|
||||
insert_data(get_temp(0x0a), 2, config_local)
|
||||
insert_data(get_temp(0x0b), 3, config_local)
|
||||
|
|
Loading…
Reference in a new issue