added formatting for C

This commit is contained in:
mischa 2019-11-06 22:24:39 +01:00
parent e79b0f5044
commit 440a9b96ee
1 changed files with 3 additions and 3 deletions

View File

@ -64,8 +64,8 @@ for key in sensors:
updated = json_data.get(i)['state']['lastupdated'][-8:]
temperature = round((json_data.get(i)['state']['temperature'] / 100), 1)
if verbose:
print (f"{name:<32s} - {temperature}C (updated: {updated} UTC)")
print (f"{name:<32s} - {temperature:>4}C (updated: {updated} UTC)")
elif debug:
print (f"{name:<32s} - {temperature}C (updated: {updated} UTC - sensor: {i})")
print (f"{name:<32s} - {temperature:>4}C (updated: {updated} UTC - sensor: {i})")
else:
print (f"{name:<32s} - {temperature}C")
print (f"{name:<32s} - {temperature:>4}C")