diff --git a/ui/main/views.py b/ui/main/views.py index c1d3996..d40eba1 100644 --- a/ui/main/views.py +++ b/ui/main/views.py @@ -26,7 +26,7 @@ def home(request): def take_photo(request): - pin_control.capture_image("/tmp/static/photo.jpg") + pin_control.capture_image(b'/tmp/static/photo.jpg') return HttpResponse("Ok") @@ -41,12 +41,12 @@ def led(request, led): def turn_off_all(): for pin in leds_gpio.values(): - pin_control.turn_on_pin(pin) + pin_control.turn_off_pin(pin) return HttpResponse("Ok") def turn_on_all(): for pin in leds_gpio.values(): - pin_control.turn_off_pin(pin) + pin_control.turn_on_pin(pin) return HttpResponse("Ok") def toggle_led(led, turn_on): @@ -56,4 +56,4 @@ def toggle_led(led, turn_on): else: pin_control.turn_on_pin(gpio_pin) leds_state[led] = not turn_on - return HttpResponse(f"Turn on {led}" if turn_on else f"Turn off {led}") \ No newline at end of file + return HttpResponse(f"Turn off {led}" if turn_on else f"Turn on {led}") \ No newline at end of file