turing-smart-screen-python icon indicating copy to clipboard operation
turing-smart-screen-python copied to clipboard

CPU & GPU Temperature Graphing Assumes Radial

Open c0ldJS opened this issue 10 months ago • 0 comments

Local Environment:

  • Turing 5" official (first party)
  • Python 3.12.X
  • Version 3.4.0 of this project in its own venv
  • Windows 11 running on metal (non-VM)

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]
  1. Save theme.yaml

Expected Results:

  • The theme file is saved without an error being returned
  • An example horizontal bar that represents CPU temperature appears in the theme preview

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:

  • Following the steps above but changing CPU to GPU and editing theme.yaml in the appropriate place leads to the same issue (halt/traceback)
  • In local testing, the theme being used/altered does not use RADIAL graphing for any configurable element
  • The use of GRAPH elsewhere in theme.yaml does not trigger the issue and a horizontal bar representing those elements will appear in the theme preview and physical display as expected
  • Current documentation for this project suggests that GRAPH is valid and available when configuring a theme to include CPU and GPU temperatures

c0ldJS avatar Apr 03 '24 17:04 c0ldJS