diff --git a/dcc/driver/connector.py b/dcc/driver/connector.py index 2819b17..4dc83fc 100644 --- a/dcc/driver/connector.py +++ b/dcc/driver/connector.py @@ -15,7 +15,7 @@ class Connector: print(message) return True - def passthrough(self, address, data): + def passthrough(self, data): self.__mqtt_pub(data) def ops(self, address, data, function=False): diff --git a/dcc/driver/urls.py b/dcc/driver/urls.py index b9941c5..ac0dec8 100644 --- a/dcc/driver/urls.py +++ b/dcc/driver/urls.py @@ -4,7 +4,7 @@ from driver.views import SendCommand, Function, Cab, Emergency, Infra urlpatterns = [ path('emergency', Emergency.as_view()), path('infra', Infra.as_view()), - path('/command', SendCommand.as_view()), + path('command', SendCommand.as_view()), path('/cab', Cab.as_view()), path('/function', Function.as_view()), ] diff --git a/dcc/driver/views.py b/dcc/driver/views.py index 0f504f1..0d45bf6 100644 --- a/dcc/driver/views.py +++ b/dcc/driver/views.py @@ -24,13 +24,12 @@ def addresschecker(f): return addresslookup -@method_decorator(addresschecker, name="put") class SendCommand(APIView): parser_classes = [PlainTextParser] - def put(self, request, address): + def put(self, request): data = request.data - conn.passthrough(address, data) + conn.passthrough(data) return Response(data, status=status.HTTP_202_ACCEPTED)