chagen path camera

This commit is contained in:
Alejandro Diaz 2023-09-13 13:36:06 -06:00
parent a60d427dd4
commit 9f827ecb55

View file

@ -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}")
return HttpResponse(f"Turn off {led}" if turn_on else f"Turn on {led}")