Removed run command from setup.sh
This commit is contained in:
6
main.py
6
main.py
@@ -22,7 +22,7 @@ if __name__ == "__main__":
|
||||
# Setup for Hardware
|
||||
DHT22_PIN = 4
|
||||
dht_device = adafruit_dht.DHT22(4)
|
||||
file = '/home/pi/code/dht22/log.csv'
|
||||
file = './log.csv'
|
||||
|
||||
with open(file,'a') as f:
|
||||
|
||||
@@ -31,7 +31,6 @@ if __name__ == "__main__":
|
||||
data = get_sensor_data(dht22=dht_device)
|
||||
if data:
|
||||
temperature, humidity = get_sensor_data(dht22=dht_device)
|
||||
# current_time = datetime.now().strftime("%D %H:%M:%S")
|
||||
current_time = datetime.now(pytz.timezone('UTC')).strftime("%D %H:%M:%S")
|
||||
print(f'{humidity:.2f}% {temperature:.2f}degF')
|
||||
f.write(f'{current_time},{temperature:.2f},{humidity:.2f}\n')
|
||||
@@ -40,7 +39,8 @@ if __name__ == "__main__":
|
||||
"datetime": current_time,
|
||||
"temperature": temperature,
|
||||
"humidity": humidity,
|
||||
"location": "basement"
|
||||
# Be Sure To Edit Location
|
||||
"location": "living_room"
|
||||
}
|
||||
creds = get_db_creds("./.creds.json")
|
||||
conn = connect_db(creds["db"], creds["host"], creds["user"], creds["passwd"])
|
||||
|
||||
Reference in New Issue
Block a user