新增灭蚊灯自动清扫接口
This commit is contained in:
parent
b95a6e0374
commit
6496583273
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue