From 649658327333e006c8c6ad7c3fd1d8e1446a61ac Mon Sep 17 00:00:00 2001 From: Jay Huang Date: Sat, 2 Dec 2023 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=81=AD=E8=9A=8A=E7=81=AF?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B8=85=E6=89=AB=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mosquito/api/views.py | 3 +++ 1 file changed, 3 insertions(+) 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)