File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 17
17
def fnGetWeather ():
18
18
data_timediff = int (config .get ('Weather' ,'Refresh' ))* 60
19
19
try :
20
- data_timediff = int (time .time ()) - int (os .path .getmtime ('data_weather.txt' ))
20
+ with open ('data_weather.txt' ) as fp :
21
+ json_obj = json .load (fp )
22
+ data_timediff = int (time .time ()) - int (json_obj ['dt' ])
23
+
21
24
except :
22
25
data_timediff = int (config .get ('Weather' ,'Refresh' ))* 61
23
26
@@ -101,11 +104,12 @@ def fnGetDlna():
101
104
value_audio = response_data [count_audio :count_audioe ]
102
105
value_audio = value_audio .replace ('Audio files</td><td>' ,'' )
103
106
value_audio = value_audio .replace ('</td>' ,'' )
107
+ value_updated = int (time .time ())
104
108
105
109
if int (value_audio ) <= 0 :
106
110
raise Exception ("No Audio??" )
107
111
108
- data = {'audio' :value_audio , 'video' :value_video }
112
+ data = {'audio' :value_audio , 'video' :value_video , 'updated' : value_updated }
109
113
with open ('data_dlna.txt' ,'w' ) as fp :
110
114
json .dump (data , fp )
111
115
You can’t perform that action at this time.
0 commit comments