chagen path camera
This commit is contained in:
parent
a60d427dd4
commit
9f827ecb55
|
@ -26,7 +26,7 @@ def home(request):
|
||||||
|
|
||||||
|
|
||||||
def take_photo(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")
|
return HttpResponse("Ok")
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,12 +41,12 @@ def led(request, led):
|
||||||
|
|
||||||
def turn_off_all():
|
def turn_off_all():
|
||||||
for pin in leds_gpio.values():
|
for pin in leds_gpio.values():
|
||||||
pin_control.turn_on_pin(pin)
|
pin_control.turn_off_pin(pin)
|
||||||
return HttpResponse("Ok")
|
return HttpResponse("Ok")
|
||||||
|
|
||||||
def turn_on_all():
|
def turn_on_all():
|
||||||
for pin in leds_gpio.values():
|
for pin in leds_gpio.values():
|
||||||
pin_control.turn_off_pin(pin)
|
pin_control.turn_on_pin(pin)
|
||||||
return HttpResponse("Ok")
|
return HttpResponse("Ok")
|
||||||
|
|
||||||
def toggle_led(led, turn_on):
|
def toggle_led(led, turn_on):
|
||||||
|
@ -56,4 +56,4 @@ def toggle_led(led, turn_on):
|
||||||
else:
|
else:
|
||||||
pin_control.turn_on_pin(gpio_pin)
|
pin_control.turn_on_pin(gpio_pin)
|
||||||
leds_state[led] = not turn_on
|
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}")
|
Loading…
Reference in a new issue