Skip to content

Conversation

@ayushsharma82
Copy link
Contributor

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

@probonopd
Copy link
Owner

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?

@ayushsharma82
Copy link
Contributor Author

@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);

@probonopd
Copy link
Owner

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
  }
}

@ayushsharma82
Copy link
Contributor Author

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

@probonopd
Copy link
Owner

Uh, do you have a clue why?

@ayushsharma82
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants