Skip to content

Commit

Permalink
Read out all data
Browse files Browse the repository at this point in the history
This helps when re-reading data off the watch
as buffers are not automatically flushed at least on windows.
This might help to prevent BadSignature issues mentioned in #27 and #30.
  • Loading branch information
mlt committed Aug 15, 2014
1 parent b60e911 commit ef80f46
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions schwinn810/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ def clear(self):
_log.warn("Debug is required for deletion for now")

def close(self):
if self._debug:
self.backup.close()

if not self.dump:
self.port.write(DISCONNECT)
self.port.read(1)
self.reader.read_end()
self.port.close()
self.port = None

if self._debug:
self.backup.close()

if __name__ == '__main__':
pass

0 comments on commit ef80f46

Please sign in to comment.