Blynk 2.0 and RPi 3 working (with the cloud server) for readings but control

I have successfully got my RPi online using Blynk 2.0 with the latest Python Blynk Library. I have three widgets on the web and mobile (android) dashboards; a button (led control) and 2 gauges (temp and humidity readings). The gauges display the correct readings on both dashboards. However, the led control is very problematic; sometimes it works once and stops and sometimes it does not work at all. Below is the python code I am using for controlling the led. I would appreciate your help in having a solid repeatable led control.

import time
import board
import adafruit_dht
from digitalio import DigitalInOut, Direction, Pull
import BlynkLib

#Define Digital PIN on GPIO
led = DigitalInOut(board.D18)
led.direction = Direction.OUTPUT

# Register Virtual Pins
@blynk.on("V0")
def v0_write_handler(value):
print('Current V0 value: {}'.format(value[0]))
if int(format(value[0])) == 1:
       led.value= True
else:
       led.value=False

blynk.run()

LED widgets require a value of 255 to turn them on at full brightness in C++ I don’t know if it’s the same for Python.

Pete.

Thanks, Pete, The same hardware worked consistently with the Blynk legacy. Also, I am not using an LED widget ; I am using a button widget. The only change I made is in the python code as follows:

with the older Blynk Python Library (Blynk Legacy)

@blynk.VIRTUAL_WRITE(0)
def v0_write_handler(value):

with the new Blynk Python Library (Blynk IoT)

@blynk.on("V0")
def v0_write_handler(value):

since the attribute/method VIRTUAL_WRITE() is no longer available with the latest Python Blynk Library. I selected @blynk.on() based on the example given in blynk-library-python/examples/02_on_virtual_change.py in https://github.com/vshymanskyy/blynk-library-python/blob/master/

I would appreciate help in validating whether the new method blynk.on() is the right method to be used with Blynk IoT.
Thanks
Emil