def __history_get(self,history,item_ID,time_from,time_till):
'''
????
???? item ??????? history ?
'''
history_data=[]
history_data[:]=[]
response=self.zapi.history.get({
"time_from":time_from,
"time_till":time_till,
"output": "extend",
"history": history,
"itemids": item_ID,
"sortfield":"clock",
"limit": 10080
})
if len(response) == 0:
warn_msg("not have history_data")
debug_info=str([history,item_ID,time_from,time_till,"####not have history_data"])
self.logger.debug(debug_info)
return 0.0
for history_info in response:
timeArray = time.localtime(int(history_info['clock']))
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
print(item_ID,history_info['value'],otherStyleTime)
评论列表
文章目录