summaryrefslogtreecommitdiffstats
path: root/glucometerutils/drivers/otultra2.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update typing to PEP 585 style.Diego Elio Pettenò2023-08-031-1/+1
| | | | | This replaces the usage of generics from `typing` with built-in or from `collections.abc` since Python 3.9 is the minimum supported version.
* Rename driver.GlucometerDriver to driver.GlucometerDevice.Diego Elio Pettenò2020-04-091-1/+1
| | | | | The "driver" is the module — the classes need to be called Device. This allows adding further typing around this.
* Move driver_base to glucometerutils.driver instead.Diego Elio Pettenò2020-04-091-3/+3
| | | | This makes it more like the other common modules, and allows expanding the interfaces.
* Add missing SPDX-FileCopyrightText throughout the project.Diego Elio Pettenò2020-03-271-0/+1
| | | | This is following the advice provided in https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code
* The big typing cleanup.Diego Elio Pettenò2020-03-271-16/+20
| | | | | | | | Now that Python 3.7 is the minimum Python version, typing can be done inline, which makes it easier for mypy to know the files to check. Indeed, all the files are now typechecked, which uncovered a few minor bugs and mistakes here and there.
* format code with blackBen2020-03-081-55/+57
|
* factor out common driver methodsBen2020-02-181-17/+3
|
* Bugfix: get current time within the functionBen2020-02-181-1/+4
|
* Replace epydoc metadata with SPDX identifiers.Diego Elio Pettenò2019-02-081-5/+2
| | | | | | | | | | Most of the epydoc metadata (author, copyright, email) is duplicate in the package's setup.py or README. These copies are more likely to get out of date, and increase the amount of work to keep them in line. The license information should rather be provided with an SPDX identifier, which is more similar to what the Linux kernel and other projects, such as pyserial, do.
* Replace flameeyes.eu with flameeyes.com.Diego Elio Pettenò2019-02-081-1/+1
| | | | | | | | Due to EURid threatening to suspend my domain, make sure that the references are updated to point at the right stable domain. This includes changes to the files as well as a mailmap to update the author references in the log.
* Fix most of the pylint output, and hide away some that is not needed.Diego Elio Pettenò2018-12-121-49/+51
| | | | Again, this is not ready for CI yet unfortunately :(
* Reindent all files to match the 4-spaces indentation.Diego Elio Pettenò2018-12-121-193/+193
|
* Use Python3 Enum class for meal flags.Diego Elio Pettenò2017-12-281-3/+3
| | | | This makes the code more idiomatic and less brittle.
* Use Python3 Enum class for glucose units.Diego Elio Pettenò2017-12-281-4/+4
| | | | This makes the code more idiomatic and less brittle.
* common: rename Reading class into GlucoseReading classSamuel Martin2017-09-251-1/+1
| | | | This renaming prepares for the ketone class introduction.
* All drivers: move documentation of features from README to docstring.Diego Elio Pettenò2017-04-171-1/+11
| | | | | | | | This allows the drivers to keep up to date with what they support and need. Should make Issue #9 easier to solve. Also merge the dependency list with the list of supported devices, so that you don't have to join the two tables in your head.
* Serial drivers: factor out opening of the serial port to a new base class.Diego Elio Pettenò2017-04-171-12/+4
| | | | | | This allows the serial support class to open the serial port without each driver having to pass the same long list of parameters, given that effectively all the meters use the same parameters, except few.
* serial drivers: if no --device parameter is given, look for default cable.Diego Elio Pettenò2017-04-151-5/+5
| | | | | | | | pyserial makes it very easy to look for a serial port based on VID/PID pairs, so use those when possible. Unfortunately serial drivers are also the least reliable as all of the cables but Abbott's use generic IDs. This keeps in the direction of solving Issue 9.
* all drivers: make --device optional at the tool level.Diego Elio Pettenò2017-04-151-0/+5
| | | | | | | | This requires the drivers to validate their device, but also means they can provide a more explicit error message for the user as to what should be passed. This is a first step to help solving Issue 9.
* Update copyrights, cleanup whitespace where needed.Diego Elio Pettenò2017-01-161-1/+1
|
* LifeScan devices: move lifescan_common to the support directory.Diego Elio Pettenò2017-01-161-3/+3
| | | | | This makes it easier to figure out which files represent drivers, and which ones are per-vendor support modules.
* Wrap the meter information to a namedtuple, instead of a string.Diego Elio Pettenò2017-01-151-13/+9
| | | | | | This matches the gdef MeterInfo message, and produces a similar (though not identical) string as before. Importantly, it allows providing semantic information.
* Fix error in call to map() functionL. Guruprasad2016-11-161-2/+2
|
* Use a more Pythonic map(..., int) instead of list comprehension.Diego Elio Pettenò2016-03-021-2/+2
|
* Move the InvalidChecksum exception to the base exceptions module.Diego Elio Pettenò2016-03-021-3/+3
| | | | | Most glucometers have *some* sort of checksum, so there is no reason to implement this on a per-driver basis.
* otultra2: make the before/after meal constants in common module.Diego Elio Pettenò2016-02-151-3/+3
| | | | This will lead the way to providing meal information with future drivers.
* otultra2: avoid using connect/disconnect to wake up the device.Diego Elio Pettenò2014-02-081-3/+2
| | | | It seems like the device is very sensible to the reset command.
* otultra2: move checksum function within otultra2 driver.Diego Elio Pettenò2014-01-291-1/+20
| | | | | The function is not shared with the Ultra Easy and likely not with other devices either.
* Add connect/disconnect methods to otultra2 and send \x11\r on connection.Diego Elio Pettenò2014-01-291-5/+8
| | | | | The otultraeasy requires explicit connect/disconnect so implementing this before is helpful.
* Clean up the code to remove methods that should be functions and imports.Diego Elio Pettenò2013-12-111-119/+113
|
* Change all the internal representations to mg/dL for compatibility with LifeScan.Diego Elio Pettenò2013-12-111-5/+4
| | | | | | While mmol/L is the international standard unit, at least LifeScan uses mg/dL in all their devices, and since they are the ones for which we have protocols for, we might as well use the same.
* Generalise the meal/comment handling to the Reading object.Diego Elio Pettenò2013-12-111-4/+3
| | | | | While not all readers implement before/after meal notes, it's possible to implement an heuristics for that.
* otultra2: expose the meal and comments as separate field in the CSV.Diego Elio Pettenò2013-12-111-5/+1
| | | | | Idea by Jim Sifferle, implemented in a slightly different way as I noticed I forgot to quote it properly.
* Better error handling.Diego Elio Pettenò2013-12-081-1/+1
| | | | | If any exception is thrown by the library, print an error statement and return a non-zero exit value.
* Add a new command to dump the identification of the glucometer.Diego Elio Pettenò2013-12-081-0/+18
| | | | This allows to get the serial number, as well as other details about the glucometer once it's installed.
* otultra2: implement a zero log command to clear a device's memory.Diego Elio Pettenò2013-12-081-1/+11
|
* otultra2: implement decoding of meal and comment codes.Diego Elio Pettenò2013-12-081-1/+31
| | | | This also dumps the comment with the dump command.
* Read more data out of the OTUltra2 dump lines. Return data in a Reading object.Diego Elio Pettenò2013-09-291-10/+11
| | | | | The Reading object will be extended to cater for flags, comments and other device-specific information.
* Relicense everything under MIT license.Diego Elio Pettenò2013-08-031-1/+1
| | | | | There is no reason for me to use GPLv3 now that I'm not using the CRC32-Sick code, so I'll go with the most liberal license out there.
* Add support for checksum verification for the otultra2 driver.Diego Elio Pettenò2013-08-031-17/+16
| | | | | | | This introduced some changes in the Exception class to simplify the code, and at the same time it adds a module for multiple lifescan drivers to share code (multiple OneTouch protocols share the same checksum for instance).
* Update function names to follow PEP8.Diego Elio Pettenò2013-08-031-27/+27
|
* Add utf-8 encoding specification to all files.Diego Elio Pettenò2013-08-031-0/+1
|
* otultra2: fix default unit handling.Diego Elio Pettenò2013-08-031-1/+2
|
* Initial import of the raw data.Diego Elio Pettenò2013-08-031-0/+257