Beispiel #1
0
 def get_report_info(self, meter_code, start_time, end_time):
     url, data = self.get_local_data(6)
     report_data = json.loads(data)
     report_data["meterId"] = meter_code
     report_data["startTime"] = handle_time.update_specified_time(
         hour=start_time, minute="00", second="00")
     report_data["endTime"] = handle_time.update_specified_time(
         hour=end_time, minute="00", second="00")
     return os.getenv("host") + url, report_data
Beispiel #2
0
 def get_consump_tion_statistic(self, meter_code):
     url, data = self.get_local_data(10)
     report_data = json.loads(data)
     report_data["meterId"] = meter_code
     report_data["startTime"] = handle_time.update_specified_time(
         day=-2, hour="00", minute="00", second="00")
     report_data["endTime"] = handle_time.update_specified_time(hour="00",
                                                                minute="00",
                                                                second="00")
     return os.getenv("host") + url, report_data
Beispiel #3
0
 def get_history_data_info(self, meter_code):
     url, data = self.get_local_data(7)
     report_data = json.loads(data)
     report_data["meterId"] = meter_code
     report_data["endTime"] = handle_time.update_specified_time(hour="01",
                                                                minute="00",
                                                                second="00")
     report_data["startTime"] = handle_time.update_specified_time(
         day=-1, hour="00", minute="00", second="00")
     return os.getenv("host") + url, report_data
Beispiel #4
0
 def generate_after_day(self, start_time):
     for i in range(0, start_time + 1):
         if i < 10:
             i = "0" + str(i)
         self.data.append(
             handle_time.update_specified_time(hour=i,
                                               minute="00",
                                               second="00"))
Beispiel #5
0
 def generate_current_day(self, start_time):
     for item in range(start_time, 24):
         if item < 10:
             item = "0" + str(item)
         self.data.append(
             handle_time.update_specified_time(day=-1,
                                               hour=item,
                                               minute="00",
                                               second="00"))