|
@@ -18,7 +18,7 @@ from app.resources.params import (
|
|
|
SWITCH_RELATED_FEEDBACK
|
|
|
)
|
|
|
from app.services.platform import DataPlatformService
|
|
|
-from app.services.transfer import TransferService, Season
|
|
|
+from app.services.transfer import SpaceInfoService, Season
|
|
|
from app.utils.date import get_time_str, get_quarter_minutes, TIME_FMT
|
|
|
|
|
|
|
|
@@ -288,11 +288,11 @@ class Co2TargetController(TargetController):
|
|
|
async def readjust_all_target(project_id: str, space_id: str, wechat_time: str):
|
|
|
start = time.perf_counter()
|
|
|
async with AsyncClient() as client:
|
|
|
- transfer = TransferService(client, project_id, space_id)
|
|
|
- platform = DataPlatformService(client, project_id, space_id)
|
|
|
+ transfer = SpaceInfoService(client, project_id, space_id)
|
|
|
+ platform = DataPlatformService(client, project_id)
|
|
|
|
|
|
nl = '\n'
|
|
|
- realtime_temperature = await platform.get_realtime_temperature()
|
|
|
+ realtime_temperature = await platform.get_realtime_temperature(space_id)
|
|
|
logger.debug(f'realtime temperature: {realtime_temperature}')
|
|
|
current_targets = await transfer.get_custom_target()
|
|
|
logger.debug(f'current targets: {nl}{current_targets}')
|
|
@@ -322,7 +322,7 @@ async def readjust_all_target(project_id: str, space_id: str, wechat_time: str):
|
|
|
need_run_room_control = False
|
|
|
if need_switch_off:
|
|
|
async with AsyncClient() as client:
|
|
|
- transfer = TransferService(client, project_id, space_id)
|
|
|
+ transfer = SpaceInfoService(client, project_id, space_id)
|
|
|
await transfer.set_temporary_custom()
|
|
|
|
|
|
return need_run_room_control
|
|
@@ -346,7 +346,7 @@ async def readjust_all_target(project_id: str, space_id: str, wechat_time: str):
|
|
|
if temperature_results:
|
|
|
need_run_room_control = True
|
|
|
async with AsyncClient() as client:
|
|
|
- transfer = TransferService(client, project_id, space_id)
|
|
|
+ transfer = SpaceInfoService(client, project_id, space_id)
|
|
|
|
|
|
if temperature_results.get('temporary_targets'):
|
|
|
temporary_targets = temperature_results.get('temporary_targets')
|