summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support/freestyle.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2020-03-26 19:56:13 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-26 20:00:32 +0100
commit9433599de3d9c8e10a9985e3c40a7eb35eeb784d (patch)
treee78c28234f22713e1d9a0ca0bc5f55a658a5e602 /glucometerutils/support/freestyle.py
parentUpdate the local Emacs config to match the black/isort/flake8 configs. (diff)
downloadglucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar.gz
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar.bz2
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar.lz
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar.xz
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.tar.zst
glucometerutils-9433599de3d9c8e10a9985e3c40a7eb35eeb784d.zip
Diffstat (limited to '')
-rw-r--r--glucometerutils/support/freestyle.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py
index b1eb2d2..c77282b 100644
--- a/glucometerutils/support/freestyle.py
+++ b/glucometerutils/support/freestyle.py
@@ -12,7 +12,6 @@ import csv
import datetime
import logging
import re
-from abc import ABC
from typing import AnyStr, Callable, Iterator, List, Optional, Text, Tuple
import construct
@@ -185,7 +184,8 @@ class FreeStyleHidSession:
if not encrypted or message_type in _ALWAYS_UNENCRYPTED_MESSAGES:
message_length = usb_packet[1]
- message_content = usb_packet[2 : 2 + message_length]
+ message_end_idx = 2 + message_length
+ message_content = usb_packet[2:message_end_idx]
else:
message_content = usb_packet[1:]
@@ -340,7 +340,7 @@ class FreeStyleHidDevice(driver_base.GlucometerDriver):
except UnicodeDecodeError:
raise ValueError("Only ASCII-safe names are tested working")
- result = self._session.send_text_command(b"$ptname," + encoded_name)
+ self._session.send_text_command(b"$ptname," + encoded_name)
def get_datetime(self):
# type: () -> datetime.datetime