|
@@ -1,6 +1,7 @@
|
|
|
from fastapi import APIRouter, Depends, Query
|
|
|
from loguru import logger
|
|
|
from sqlalchemy.orm import Session
|
|
|
+import numpy as np
|
|
|
|
|
|
import app.models.domain.devices as domain_devices
|
|
|
from app.api.dependencies.db import get_db
|
|
@@ -265,10 +266,12 @@ async def get_acatva_instructions(params: domain_devices.ACATVAInstructionsReque
|
|
|
logger.info(params)
|
|
|
logger.info(f'{params.device_id} - {instructions}')
|
|
|
|
|
|
- response = domain_devices.ACATVAInstructionsResponse(
|
|
|
- SupplyAirFlowSet=instructions.supply_air_flow_set,
|
|
|
- VirtualRealtimeTemperature=instructions.virtual_realtime_temperature,
|
|
|
- TargetTemperatureSet=instructions.virtual_temperature_target_set
|
|
|
- )
|
|
|
+ resp = dict()
|
|
|
+ if not np.isnan(instructions.supply_air_flow_set):
|
|
|
+ resp.update({'SupplyAirFlowSet': instructions.supply_air_flow_set})
|
|
|
+ if not np.isnan(instructions.virtual_realtime_temperature):
|
|
|
+ resp.update({'VirtualRealtimeTemperature': instructions.virtual_realtime_temperature})
|
|
|
+ if not np.isnan(instructions.virtual_temperature_target_set):
|
|
|
+ resp.update({'TargetTemperatureSet': instructions.virtual_temperature_target_set})
|
|
|
|
|
|
- return response
|
|
|
+ return resp
|