OXRS-IO / OXRS-IO-TouchPanel-ESP32-FW

OXRS compatible firmware for WT32-xxx touch screen displays
https://oxrs.io/docs/firmware/touch-panel-esp32.html
BSD 3-Clause "New" or "Revised" License
20 stars 3 forks source link

Allow configuration of backgroundImage over conf topic #77

Closed hazymat closed 1 year ago

hazymat commented 1 year ago

See discord chat

The process of uploading and setting a backgroundImage to a tile was recently changed, and it's now similar to custom icons.

However I believe there is a small inconsistency:

To set a tile's icon (custom or builtin), you can send a message to the conf topic like this:

{
  "screens": [
    {
      "screen": 1,
      "label": "Control",
      "tiles": [
        {
          "tile": 1,
          "style": "button",
          "icon": "shutdown",
          "label": "OFF"
        }
      ]
    }
  ]
}

But with backgroundImage, it seems you can only assign the image to the tile using a cmnd message, to the cmnd topic. Is that correct? According to my testing, it does not work to assign the image name to the tile using conf.

For example I would like to send this to conf/<device-client-id>:

{
  "screens": [
    {
      "screen": 1,
      "label": "Control",
      "tiles": [
        {
          "tile": 1,
          "style": "button",
          "backgroundImage": "myCustomImage",
          "label": "OFF"
        }
      ]
    }
  ]
}

For the sake of consistency, please can you allow setting the tile's backgroundImage via the configuration message (and also keep the ability to do this via a command message later)?