mirror of
https://github.com/s00500/ESPUI.git
synced 2025-07-04 11:20:19 +00:00
Added the dropdown-Control
* added the Control * added the frontend-code * added the control to the examples "gui-newAPI.ino" and "tabbedGui.ino"
This commit is contained in:
@ -370,6 +370,10 @@ void onWsEvent( AsyncWebSocket* server, AsyncWebSocketClient* client,
|
||||
String value = msg.substring( msg.indexOf( ':' ) + 1, msg.lastIndexOf( ':' ) );
|
||||
ESPUI.updateText( c->id, value, client->id() );
|
||||
c->callback( c, T_VALUE );
|
||||
} else if ( msg.startsWith( "svalue:" ) ) {
|
||||
String value = msg.substring( msg.indexOf( ':' ) + 1, msg.lastIndexOf( ':' ) );
|
||||
ESPUI.updateSelect( c->id, value, client->id() );
|
||||
c->callback( c, S_VALUE );
|
||||
} else {
|
||||
if ( ESPUI.verbosity ) {
|
||||
Serial.println( "Malformated message from the websocket" );
|
||||
@ -601,6 +605,14 @@ void ESPUIClass::updateText( String label, String text, int clientId ) {
|
||||
updateControl( label, text, clientId );
|
||||
}
|
||||
|
||||
void ESPUIClass::updateSelect( uint16_t id, String text, int clientId ) {
|
||||
updateControl( id, text, clientId );
|
||||
}
|
||||
|
||||
void ESPUIClass::updateSelect( String label, String text, int clientId ) {
|
||||
updateControl( label, text, clientId );
|
||||
}
|
||||
|
||||
/*
|
||||
Convert & Transfer Arduino elements to JSON elements
|
||||
Initially this function used to send the control element data individually.
|
||||
|
Reference in New Issue
Block a user