<commit_before>from django.http import JsonResponse, HttpResponse
from django.views.generic import View
import RPi.GPIO as GPIO
from GarageWarden import settings


class StatusView(View):
    def get(self, request):
        if not request.user.is_authenticated:
            return HttpResponse("Not logged in", status=401)
        return JsonResponse({"garageFullOpen": garage_is_full_open(), "garageFullClose": garage_is_full_close()})


def garage_is_full_open():
    return 1 == GPIO.input(settings.FULL_OPEN_SWITCH_PIN)


def garage_is_full_close():
    return 1 == GPIO.input(settings.FULL_CLOSE_SWITCH_PIN)<commit_msg>Changed status checks to be true when low since this is how the actual door switches work<commit_after>from django.http import JsonResponse, HttpResponse
from django.views.generic import View
import RPi.GPIO as GPIO
from GarageWarden import settings


class StatusView(View):
    def get(self, request):
        if not request.user.is_authenticated:
            return HttpResponse("Not logged in", status=401)
        return JsonResponse({"garageFullOpen": garage_is_full_open(), "garageFullClose": garage_is_full_close()})


def garage_is_full_open():
    return 0 == GPIO.input(settings.FULL_OPEN_SWITCH_PIN)


def garage_is_full_close():
    return 0 == GPIO.input(settings.FULL_CLOSE_SWITCH_PIN)
{'fraction_non_alphanumeric': 0.08610271903323263, 'fraction_numerical': 0.0075528700906344415, 'mean_word_length': 4.995475113122172, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773119', 'n_tokens_mistral': 408, 'n_tokens_neox': 385, 'n_words': 105}