vshymanskyy / blynk-library-python

Blynk library for Python. Works with Python 2, Python 3, MicroPython.
https://blynk.io/
MIT License
286 stars 98 forks source link

error on blynk.on #52

Closed defaliz closed 3 years ago

defaliz commented 3 years ago

Hi, i try examples , each time blynk.on is used i have the same error

" @blynk.on("connected") TypeError: on() takes exactly 3 arguments (2 given)"

why ?, thanks for replies regards

defaliz commented 3 years ago

i answer myself.. i've made a mistake.. it's works when examples are in the same place than BlynkLib.py

have a good day

ratheeshbr commented 3 years ago

Is there any way to clear this error

ratheeshbr commented 3 years ago

TypeError: my_write_handler() takes exactly 1 argument (0 given)

ploebb commented 3 years ago

There are two methods defined in BlynkLib.py: def on(self, evt, func): and def ON(blynk, evt): In the examples, the lower case is used where the upper case ON should be used (bug?)!

So for example, change @blynk.on("connected") to @blynk.ON("connected") and it should work.