karioja / vedirect

Simple VE.Direct reader for Python
MIT License
94 stars 38 forks source link

packet is not cleared between callbacks #10

Open kjkoster opened 3 years ago

kjkoster commented 3 years ago

Thank you for publishing this code.

I found that packets are not cleared between call-back invocations. This means that the packet dict may contain lingering values from previous callbacks and not only data from the very last message out of the MPPT.

To reproduce, simply add a key+value to the packet in the callback and note that it is retained across callbacks.

kjkoster commented 3 years ago

I work around this by calling packet.clear() at the end of my callback implementation. Not pretty, but effective.