Explorar o código

turn off ventilation on weekend

chenhaiyang %!s(int64=4) %!d(string=hai) anos
pai
achega
316c93726f
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      app/controllers/equipment/ventilation_fan/switch.py

+ 2 - 0
app/controllers/equipment/ventilation_fan/switch.py

@@ -16,5 +16,7 @@ class VentilationFanSwitch(Switch):
 async def ventilation_fan_switch_control(project_id: str, equipment_id: str) -> None:
     equip_params, day_type = await fetch_data(project_id, equipment_id)
     action = await VentilationFanSwitch(VentilationFan(**equip_params)).build_next_action(day_type.get('day_type'))
+    if day_type != 'WeekDay':
+        action = 'off'
     logger.debug(f'VTSF-{equipment_id}: {action}')
     await send_switch_command(project_id, equipment_id, action)