Status Card




A status indicator component that displays state information with 4 distinct status types - idle, warning, success, and danger. Each status type can be accompanied by a custom message to provide contextual feedback on the dashboard.
Valid Statuses
DASH_STATUS_SUCCESS
- Success (Green)DASH_STATUS_WARNING
- Warning (Yellow)DASH_STATUS_DANGER
- Danger (Red)DASH_STATUS_IDLE
- Idle (Grey)
Initializer
/*
Status Card
Valid Arguments: (ESPDash dashboard, Card Type, const char* name, const char* status (optional) )
*/
Card card1(&dashboard, STATUS_CARD, "Test Status", DASH_STATUS_SUCCESS);
Callback
💡
Status card doesn’t require any callback.
Updater
Status card updater allows you to set a message:
card1.update("message");
Or, message + status at the same time:
card1.update("Message", DASH_STATUS_SUCCESS);
Reference
This is a reference sketch showing positions for intializer and updater.
...
/* Status card initializer */
Card status(&dashboard, STATUS_CARD, "Test Status", DASH_STATUS_SUCCESS);
void setup() {
...
/* Status card updater - can be used anywhere (apart from global scope) */
status.update("Warning message", DASH_STATUS_WARNING);
}
void loop() {
...
}