11import time
22import datetime
33
4- import upload
5- import datetimeutil
6-
74
85class PVOutputUploader (object ):
96 def __init__ (self , db , system , pvoutput ):
@@ -23,7 +20,6 @@ def setVerbose(self, verbose):
2320 # @fixme move this batching into pvoutput
2421 def send_production (self , entries ):
2522 batch = []
26- last_total_production = - 1 # unlikely...
2723
2824 too_old_in_days = self .pvoutput .days_ago_accepted_by_api ()
2925
@@ -45,8 +41,6 @@ def send_production(self, entries):
4541 dt = datetime .datetime .fromtimestamp (timestamp )
4642 batch .append ([dt , total_production ])
4743
48- last_total_production = total_production
49-
5044 if len (batch ) == self .pvoutput .batchstatus_count_accepted_by_api ():
5145 if havesent :
5246 # if we do *not* wait, other requests can get served
@@ -134,16 +128,17 @@ def upload_unuploaded_statuses(self):
134128 # @param day day to upload for
135129 # @note The day *must be over* for this not to screw you over.
136130 # @note no way to tell if all inverters have reported in....
137- def upload_statuses_for_day (self , day ):
138- date = day .date ()
139- ts_start , ts_end = datetimeutil .day_timestamps (date ,
140- self .system .timezone ())
141- ids = [i .serial for i in self .system .inverters ()]
142-
143- entries = db .get_aggregate_historic (ts_start , ts_end , ids )
144- entries = prepare_data_for_date (date , results , sc .timezone ())
145-
146- self .send_production (entries )
131+ # def upload_statuses_for_day(self, day):
132+ # date = day.date()
133+ # ts_start, ts_end = datetimeutil.day_timestamps(date,
134+ # self.system.timezone())
135+ # ids = [i.serial for i in self.system.inverters()]
136+ #
137+ # entries = db.get_aggregate_historic(ts_start, ts_end, ids)
138+ # entries = prepare_data_for_date(date, entries,
139+ # self.system.timezone())
140+ #
141+ # self.send_production(entries)
147142
148143 # print out a message only if we're verbose
149144 def debug (self , message ):
@@ -276,7 +271,7 @@ def do_date(self, date, fix):
276271 print (" upload data for a specific date (%s)" % date )
277272 day = self .pvoutput .parse_date_and_time (date , "00:00" )
278273 self .upload_statuses_for_day (day )
279- sleep (20 ) # so the reconcile works....
274+ time . sleep (20 ) # so the reconcile works....
280275
281276 if True :
282277 print ("reconciling specific date (%s)" % date )
0 commit comments