WirelessPrinting icon indicating copy to clipboard operation
WirelessPrinting copied to clipboard

Added ESP-DASH ( Base Template )

Open ayushsharma82 opened this issue 5 years ago • 6 comments

Added ESP-DASH Core functions. Please use this template as a base to add more functions to the dashboard.

ESP-DASH Docs: https://github.com/ayushsharma82/ESP-DASH/wiki/Building-Sketch

ayushsharma82 avatar Jul 23 '19 17:07 ayushsharma82

Hi, thanks for adding this. Looking at the code it is not evident to me where the widgets are getting their data from, how does it work?

probonopd avatar Jul 23 '19 19:07 probonopd

@probonopd ESP-DASH Works on 2 methods: addCard and updateCard. Add Card Method is used to add a card on the dashboard while the update card method is used to update the values of that specific card.

A Unique ID is used for every card while adding a card. ie: https://github.com/probonopd/WirelessPrinting/pull/134/files#diff-ef932246a9d229efe8048ee0dccbddbfR856 Example: ESPDash.addTemperatureCard("bed", unit, value);

That same ID will be used to update the card in the future. Example: ESPDash.updateTemperatureCard("bed", value);

ayushsharma82 avatar Jul 24 '19 07:07 ayushsharma82

Thanks @ayushsharma82 can you add an example to your code that uses the data at /api/printer? There we have

{
  "state": {
    "text": "Operational",
    "flags": {
      "operational": true,
      "paused": false,
      "printing": false,
      "pausing": false,
      "cancelling": false,
      "sdReady": false,
      "error": false,
      "ready": true,
      "closedOrError": false
    }
  },
  "temperature": {
    "tool0": {
      "actual": 28.61,
      "target": 0.00,
      "offset": 0
    },
    "bed": {
      "actual": 28.58,
      "target": 0.00,
      "offset": 0
    }
  },
  "sd": {
    "ready": false
  }
}

probonopd avatar Jul 25 '19 05:07 probonopd

It compiles but crashes in real-life testing on an esp8266.

ayushsharma82 avatar Jul 26 '19 06:07 ayushsharma82

Uh, do you have a clue why?

probonopd avatar Jul 26 '19 06:07 probonopd

No clue yet. I will check for the error later on.

ayushsharma82 avatar Jul 26 '19 06:07 ayushsharma82