Skip to content

Commit

Permalink
Update garden-temps.py
Browse files Browse the repository at this point in the history
  • Loading branch information
waded committed Mar 5, 2021
1 parent f85f4f0 commit 9dd24ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions garden-temps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def main():
client.loop_start()
while True:
print('tick')
time = datetime.datetime.now()
now = datetime.datetime.now()

for file in os.listdir(DEVICE_PATH):
device_path = os.path.join(DEVICE_PATH, file)
device_path = os.path.join(device_path, 'w1_slave')
if (os.path.isfile(device_path)):
temp = read_temp(device_path)
event_name = file
client.publish('temperature', f'{time},{file},{temp}')
client.publish('temperature', f'{now},{file},{temp}')

time.sleep(int(INTERVAL_S))

Expand Down

0 comments on commit 9dd24ce

Please sign in to comment.