|
@@ -27,6 +27,7 @@ import paramiko
|
|
import zipfile
|
|
import zipfile
|
|
from datetime import datetime, timedelta
|
|
from datetime import datetime, timedelta
|
|
from typing import Optional
|
|
from typing import Optional
|
|
|
|
+from pytz import timezone
|
|
import shutil
|
|
import shutil
|
|
import tempfile
|
|
import tempfile
|
|
api_url = 'http://itil.jiayuepowertech.com:9958/itil/api/stationModelConfig'
|
|
api_url = 'http://itil.jiayuepowertech.com:9958/itil/api/stationModelConfig'
|
|
@@ -38,7 +39,7 @@ nick_name = {
|
|
model_type_dict = {
|
|
model_type_dict = {
|
|
'cdq': '0',
|
|
'cdq': '0',
|
|
'dq': '1',
|
|
'dq': '1',
|
|
- 'czq': '2'
|
|
|
|
|
|
+ 'zcq': '2'
|
|
}
|
|
}
|
|
# 配置信息
|
|
# 配置信息
|
|
SFTP_HOST = '192.168.1.33'
|
|
SFTP_HOST = '192.168.1.33'
|
|
@@ -100,7 +101,7 @@ def model_station_handler(api_data):
|
|
def get_next_target_time(current_time=None):
|
|
def get_next_target_time(current_time=None):
|
|
"""获取下一个目标时刻"""
|
|
"""获取下一个目标时刻"""
|
|
if current_time is None:
|
|
if current_time is None:
|
|
- current_time = datetime.now()
|
|
|
|
|
|
+ current_time = datetime.now(timezone('Asia/Shanghai'))
|
|
|
|
|
|
target_hours = [0, 6, 12, 18]
|
|
target_hours = [0, 6, 12, 18]
|
|
current_hour = current_time.hour
|
|
current_hour = current_time.hour
|