BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk buttons stop working after function runs

I’m using Blynk’s python library, I have this code:

@blynk.VIRTUAL_WRITE(3)
def controlFans(value):
if int(value[0]) == 1:
		print('> Fans turned on')
		blynk.virtual_write(5, 'Fans on')
		GPIO.output(RELAY1_PIN, GPIO.LOW)
	else:
		print('> Fans turned off')
		blynk.virtual_write(5, 'Fans off')
		GPIO.output(RELAY1_PIN, GPIO.HIGH)

def adjustHumidity():
	hum, temp = checkSensorData()
	logging.warning('Minimum humidity reached. Mist on. Temp: {} ,Hum: {}'.format(round(temp, 2),round(hum, 2)))
	startTime = time.time()
	blynk.virtual_write(5, 'Adjusting humidity')

	flag = False

	while flag == False:
		blynk.virtual_write(5, 'Adjusting humidity')
		GPIO.output(RELAY2_PIN, GPIO.LOW)
		time.sleep(MIST_DURATION)

		hum, temp = checkSensorData()
		print('checking sensor on adjusting hum')
		blynk.virtual_write(TEMP_VPIN, temp)
		blynk.virtual_write(HUM_VPIN, hum)

		if hum > MIN_HUM_VALUE:
			print('> Done misting')
			GPIO.output(RELAY2_PIN, GPIO.HIGH)
			flag = True
	

	blynk.virtual_write(5, 'Normal')

try:
    while True:
          blynk.run()
          blynkTimer.run()
except KeyboardInterrupt:
         blynk.disconnect()

Of course is not my full program because that is about 300 lines, but I will describe where my problem is briefly:
My program checks humidity value from a sensor using a blynk timer, every 15 seconds. If it reaches a given value, it calls the function ‘adjustHumidity()’, which, as its name says, adjust the humidity and checks again every 5 seconds, instead of the blynk timer (15s)

The problem is that while my program is in that function and AFTER it goes back to the main loop, the buttons I have stop working. They work when I just launch my program, but they just stop working after that point.

I would appreciate any help with this. Thanks in advance.