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

Multiple "display value" widgets doesn't work with python lib

I am using IOS BLynk app. Hardware is Raspberry pi. Software is Python 3.5.
The test code to highlight the problem is very simple: it’s just two VP events handlers: one for VP0 and one for VP1. The two of them do the same very simple thing: display a random number on a “display value” widget on the app. The two “display value” widgets have a refresh interval of 1s.
It’s impossible to have the two widget display their respective random number. One doesn’t display any thing.
Any idea ?

BLYNK_AUTH = 'e198d12e7f8443c4a97ac1f4b0ac43cc'
blynk = blynklib.Blynk(BLYNK_AUTH)

# register handler for virtual pin V0 reading 
@blynk.handle_event('read V0')
def read_virtual_pin_handler(pin):
    blynk.virtual_write(pin, random.randint(0, 255))

# register handler for virtual pin V1 reading
@blynk.handle_event('read V1')
def read_virtual_pin_handler(pin):
    blynk.virtual_write(pin, random.randint(0, 255))
    
while True:
    blynk.run()