diff options
Diffstat (limited to 'glucometerutils/support/freestyle.py')
-rw-r--r-- | glucometerutils/support/freestyle.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index 475d6f5..4684194 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -14,7 +14,7 @@ import logging import re try: - from typing import Iterator, List, Text, Tuple + from typing import Iterator, List, Optional, Text, Tuple except ImportError: pass @@ -186,6 +186,13 @@ class FreeStyleHidDevice(hiddevice.HidDevice): """Returns the serial number of the device.""" return self._send_text_command(b'$serlnum?').rstrip('\r\n') + def get_patient_name(self): + # type: () -> Optional[Text] + patient_name = self._send_text_command(b'$ptname?').rstrip('\r\n') + if not patient_name: + return None + return patient_name + def get_datetime(self): # type: () -> datetime.datetime """Gets the date and time as reported by the device. |