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
1.09k stars 182 forks source link

Ability to call external sources for values to display. #477

Open posicat opened 7 months ago

posicat commented 7 months ago

It would be really handy if the software had the ability to call out to a HTTP API, or shell out to a command to return JSON data to parse into a structure that could then be incorporated into what's displayed

API-Get:
     HTTP: http://www...
     NAME: weatherData
     FREQUENCY: 1800

API-Get:
    SHELL: /usr/local/reportPerCPULoad.sh
    NAME:CPULoad
     FREQUENCY: 10

API-Show:
    NAME: CPULoad
    FIELD: cpuLoad[0]
        PERCENTAGE:
          TEXT:
          SHOW: True
           X: 250
           Y: 13
           ... as with normal display elements.
mathoudebine commented 7 months ago

Hi, I agree this would be a nice addition. In the meantime it is possible to do it today with a bit of Python code and custom sensors if you're interested: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-themes#display-custom-data-on-a-theme