diff options
Diffstat (limited to '')
-rw-r--r-- | glucometerutils/support/freestyle.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index 4684194..13674df 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -193,6 +193,15 @@ class FreeStyleHidDevice(hiddevice.HidDevice): return None return patient_name + def set_patient_name(self, name): + # type: (Text) -> None + try: + name = name.encode('ascii') + except UnicodeDecodeError: + raise ValueError('Only ASCII-safe names are tested working') + + result = self._send_text_command(b'$ptname,' + name) + def get_datetime(self): # type: () -> datetime.datetime """Gets the date and time as reported by the device. |