1
0
mirror of https://github.com/gryf/pywmtemp.git synced 2025-12-18 20:00:18 +01:00

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 ;)
This commit is contained in:
2022-05-05 18:43:21 +02:00
parent d02ecefdf3
commit 580dc45c2a

View File

@@ -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])