We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4ad638 commit 7918f25Copy full SHA for 7918f25
library/sensors/sensors_custom.py
@@ -56,6 +56,10 @@ def as_string(self) -> str:
56
# If this function is empty, the numeric value will be used as string without formatting
57
# Example here: format numeric value: add unit as a suffix, and keep 1 digit decimal precision
58
return f'{self.as_numeric(): .1f}%'
59
+ # Important note! If your numeric value can vary in size, be sure to display it with a default size.
60
+ # E.g. if your value can range from 0 to 9999, you need to display it with at least 4 characters every time.
61
+ # --> return f'{self.as_numeric():>4}%'
62
+ # Otherwise, part of the previous value can stay displayed ("ghosting") after a refresh
63
64
65
# Example for a custom data class that only has text values
0 commit comments