# -*- coding: utf-8 -*- from loguru import logger from app.models.domain.devices import ACVTSFSwitchSetRequest from app.controllers.equipment.switch import Switch, SwitchSet from app.schemas.equipment import VentilationFan class VentilationFanSwitch(Switch): def __init__(self, equipment: VentilationFan): super(VentilationFanSwitch, self).__init__(equipment) @logger.catch() async def build_acvtsf_switch_set(params: ACVTSFSwitchSetRequest) -> SwitchSet: vrf = VentilationFan( running_status=params.running_status, in_cloud_status=params.in_cloud_status, on_time=params.on_time, off_time=params.off_time, ) action = await VentilationFanSwitch(vrf).build_next_action(params.is_workday) if not params.is_workday: action = SwitchSet.off return action