新增灭蚊灯自动清扫接口
This commit is contained in:
parent
b95a6e0374
commit
6496583273
|
@ -215,6 +215,7 @@ class DeviceInfoAPIView(ListAPIView, RoleMixin):
|
||||||
@api_view(['POST'])
|
@api_view(['POST'])
|
||||||
def remote_control(request, device_id):
|
def remote_control(request, device_id):
|
||||||
command = request.data.get('command')
|
command = request.data.get('command')
|
||||||
|
speed = request.data.get('speed')
|
||||||
|
|
||||||
if command == 'ledOn':
|
if command == 'ledOn':
|
||||||
message = {'RemoteControl': {'LED': 'ON'}}
|
message = {'RemoteControl': {'LED': 'ON'}}
|
||||||
|
@ -222,6 +223,8 @@ def remote_control(request, device_id):
|
||||||
message = {'RemoteControl': {'LED': 'OFF'}}
|
message = {'RemoteControl': {'LED': 'OFF'}}
|
||||||
elif command == 'countClear':
|
elif command == 'countClear':
|
||||||
message = {'count': 0}
|
message = {'count': 0}
|
||||||
|
elif command == 'mosqClean':
|
||||||
|
message = {'MosqDeviceClean': speed}
|
||||||
else:
|
else:
|
||||||
return Response({'error': 'Invalid command'}, status=400)
|
return Response({'error': 'Invalid command'}, status=400)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue