diff --git a/apps/mosquito/api/views.py b/apps/mosquito/api/views.py index 26f9aeb..4df72e7 100644 --- a/apps/mosquito/api/views.py +++ b/apps/mosquito/api/views.py @@ -215,6 +215,7 @@ class DeviceInfoAPIView(ListAPIView, RoleMixin): @api_view(['POST']) def remote_control(request, device_id): command = request.data.get('command') + speed = request.data.get('speed') if command == 'ledOn': message = {'RemoteControl': {'LED': 'ON'}} @@ -222,6 +223,8 @@ def remote_control(request, device_id): message = {'RemoteControl': {'LED': 'OFF'}} elif command == 'countClear': message = {'count': 0} + elif command == 'mosqClean': + message = {'MosqDeviceClean': speed} else: return Response({'error': 'Invalid command'}, status=400)