From 580dc45c2af3d5414474dde851b89567c373e8f7 Mon Sep 17 00:00:00 2001 From: gryf Date: Thu, 5 May 2022 18:43:21 +0200 Subject: [PATCH] If value for the reading is too long, trim it. I know, that this is kind of naive implementation, but in case of temperatures there is a more serious issue than trimming, if any of the HW component exceeds 1000 Celsius degrees ;) --- pywmtemp/pywmtemp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywmtemp/pywmtemp.py b/pywmtemp/pywmtemp.py index 68d3d38..18d26cc 100755 --- a/pywmtemp/pywmtemp.py +++ b/pywmtemp/pywmtemp.py @@ -265,8 +265,8 @@ class SensorDockApp(wmdocklib.DockApp): else: value = f'{value:5}' + string = f"{value}".replace('°', '\\').upper() - string = f"{value}{item['unit']}".replace('°', '\\').upper() if displacement: string = ''.join([chr(ord(i) + displacement) for i in string])