mathoudebine / turing-smart-screen-python

Unofficial Python system monitor and library for small IPS USB-C displays like Turing Smart Screen or XuanFang
GNU General Public License v3.0
966 stars 166 forks source link

CPU & GPU Temperature Graphing Assumes Radial #497

Closed c0ldJS closed 1 month ago

c0ldJS commented 3 months ago

Local Environment:

Steps to Reproduce:

  1. main.py launches successfully
  2. Display rasters the currently configured theme successfully
  3. Start theme-editor.py that targets the theme being shown on the display
  4. Edit theme.yaml
  5. In the CPU stanza, add the following TEMPERATURE configuration:
    TEMPERATURE:
      INTERVAL: 5
      GRAPH:
        SHOW: True
        X: 76
        Y: 402
        WIDTH: 200
        HEIGHT: 25
        MIN_VALUE: 0
        MAX_VALUE: 100
        BAR_COLOR: 255, 255, 255
        BAR_OUTLINE: False
        BACKGROUND_IMAGE: [RELEVANT IMAGE FILE]
  6. Save theme.yaml

Expected Results:

Issue:

Upon saving theme.yaml, the theme preview will halt (requiring manual termination by the user) and theme-editor.py issues the following traceback:

Traceback (most recent call last):
  ~\theme-editor.py", line 266, in <module>
    refresh_theme()
  ~\theme-editor.py", line 107, in refresh_theme
    stats.CPU.temperature()
  ~stats.py", line 302, in temperature
    display_themed_temperature_radial_bar(cpu_temp_graph_data, temperature)
  ~\stats.py", line 194, in display_themed_temperature_radial_bar
    display_themed_radial_bar(
  ~\stats.py", line 161, in display_themed_radial_bar
    display.lcd.DisplayRadialProgressBar(
  ~\lcd_comm.py", line 460, in DisplayRadialProgressBar
    assert 0 < bar_width <= radius, f'Progress bar linewidth is {bar_width}, must be > 0 and <= radius'
AssertionError: Progress bar linewidth is 200, must be > 0 and <= radius

The edit to theme.yaml did not utilize RADIAL or its RADIUS, ANGLE_START/END/STEPS/SEP, and CLOCKWISE configurations.

Additional Info:

mathoudebine commented 1 month ago

Thanks for raising this issue, it has now been fixed in the main branch and will be available in the next release