def main():
    vc = vcgencmd.Vcgencmd()
    fan = OutputDevice(GPIO_PIN)
    while True:
        temperature = int(vc.measure_temp())
        if ((temperature > ON_THRESHOLD) and (not fan.value)):
            fan.on()
        elif (fan.value and (temperature < OFF_THRESHOLD)):
            fan.off()
        time.sleep(SLEEP_INTERVAL)
def main():
    vc = vcgencmd.Vcgencmd()
    fan = OutputDevice(GPIO_PIN)
    while True:
        temperature = int(vc.measure_temp())
        if ((temperature > ON_THRESHOLD) and (not fan.value)):
            fan.on()
        elif (fan.value and (temperature < OFF_THRESHOLD)):
            fan.off()
        time.sleep(SLEEP_INTERVAL)