You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
It should display the string "0" representation as defined in as_string() despite the radial graph being 0 as well
Screenshots / photos of the Turing screen
Current:
It should have been like this:
Environment:
Smart screen model: Turing 3.5”
Revision of this project: main branch
OS with version: Windows 10
Python version: Python 3.11
Hardware: AMD Ryzen 7 CPU, Nvidia GPU
Additional context
The problem lies in the Context class using truthy / falsy checks instead of checking if string or numeric value is None
# library/stats.py
class Custom:
@staticmethod
def stats():
...
- if not string_value:+ if string_value is None:
string_value = str(numeric_value)
# Display text
theme_data = config.THEME_DATA["STATS"]["CUSTOM"][custom_stat].get(
"TEXT", None
)
- if theme_data and string_value:+ if theme_data and string_value is not None:
display_themed_value(theme_data=theme_data, value=string_value)
# Display graph from numeric value
theme_data = config.THEME_DATA["STATS"]["CUSTOM"][custom_stat].get(
"GRAPH", None
)
- if theme_data and numeric_value:+ if theme_data and numeric_value is not None:
display_themed_progress_bar(
theme_data=theme_data, value=numeric_value
)
# Display radial from numeric and text value
theme_data = config.THEME_DATA["STATS"]["CUSTOM"][custom_stat].get(
"RADIAL", None
)
- if theme_data and numeric_value and string_value:+ if theme_data and numeric_value is not None and string_value is not None:
display_themed_radial_bar(
theme_data=theme_data,
value=numeric_value,
custom_text=string_value,
)
The text was updated successfully, but these errors were encountered:
Describe the bug
Custom stats do not update visuals if string or numeric value is falsy (e.g. zero or empty string) but not None
To Reproduce
theme.yaml
Expected behavior
It should display the string
"0"
representation as defined inas_string()
despite the radial graph being 0 as wellScreenshots / photos of the Turing screen

Current:
It should have been like this:

Environment:
Additional context
The problem lies in the
Context
class using truthy / falsy checks instead of checking if string or numeric value is NoneThe text was updated successfully, but these errors were encountered: