openyou / emokit

Open source driver for accessing raw data from the Emotiv EPOC EEG headset
http://www.openyou.org
Other
521 stars 235 forks source link

battery "None" value causes Error in packet.__repr__ #214

Closed ppasler closed 7 years ago

ppasler commented 7 years ago

As the battery value is only set when counter is 128, otherwise it's None, calling __repr__ fails with an format Error: %d format: a number is required, not NoneType

testable with addition in example_export.py:

        while headset.running:
            try:
                packet = headset.dequeue()
                if packet is not None:
                    print packet
            except Exception as e:
                print e
                headset.stop()
            time.sleep(0.001)

I would suggest removing the battery value from __repr__