Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 850bd8c

Browse files
committed
Use generic handler
1 parent f113e2b commit 850bd8c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/sync_virtual.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
# initialize Blynk
1919
blynk = BlynkLib.Blynk(BLYNK_AUTH)
2020

21+
@blynk.ON("V*")
22+
def blynk_handle_vpins(pin, value):
23+
print("V{} value: {}".format(pin, value))
24+
2125
@blynk.ON("connected")
2226
def blynk_connected():
2327
# You can also use blynk.sync_virtual(pin)
2428
# to sync a specific virtual pin
25-
print("Updating all values from the server...")
26-
blynk.sync_all()
29+
print("Updating V1,V2,V3 values from the server...")
30+
blynk.sync_virtual(1,2,3)
2731

2832
while True:
2933
blynk.run()

0 commit comments

Comments
 (0)