Skip to content

Commit

Permalink
Fixed timestamp conversion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
frickc3 committed Feb 13, 2023
1 parent 95e06fa commit 3be2e39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from weather import main
from weather import main
main.main()
2 changes: 1 addition & 1 deletion weather/do_connect.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import network
import json
import time
import configs.config as settings
import weather.configs.config as settings

def connect():
wlan_sta = network.WLAN(network.STA_IF)
Expand Down
8 changes: 4 additions & 4 deletions weather/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def main():

station_id = settings.tempest['station-id']
token = settings.tempest['token']
#url = "http://swd.weatherflow.com/swd/rest/observations/station/52156?token=b6de0b7b-a78f-40eb-afbb-9b44679f3395"
url = "http://swd.weatherflow.com/swd/rest/observations/station/"+station_id+"?token="+token

while True:
Expand All @@ -62,10 +61,11 @@ def main():
if jbody['timezone'] == 'America/New_York':
tzoffset = (-5*3600)
else:
tzoffset = 0
tme = obs[0]['timestamp']+tzoffset
tzoffset = 0
tme = (obs[0]['timestamp']+tzoffset)
loc = time.localtime(tme)
dte = "{:02n}".format(loc[1])+"/"+"{:02n}".format(loc[2])+"/"+"{:02n}".format(loc[0])
yr = loc[0]
dte = "{:02n}".format(loc[1])+"/"+"{:02n}".format(loc[2])+"/"+"{:02n}".format(loc[0]-30)
tft.text(font,dte,80,26)
tme = "{:02n}".format(loc[3])+":"+"{:02n}".format(loc[4]) #+":"+"{:02n}".format(loc[5])
tft.text(font,tme,114,46) # was 84,64
Expand Down

0 comments on commit 3be2e39

Please sign in to comment.