Hi Rene,
Yeah, I think I know what you mean, it was a pain in the butt and super time consuming to implement trying to distinguish between text, number & custom button (the custom buttons are a lot more complex than simple text/number type)
But, I don't like things not working the way you would expect them to so I've done it now :-)
When you press the send command button it will figure out what component type it is and immediately bring you the correct entry field so there is one click less 😉
Important: All "command" data is transmitted as a "string" regardless if the type is a number so it still needs to be correctly handled on the device side (cast to the correct type)
void ChipChop_onCommandReceived(String target_component,String command_value, String command_source, int command_age){
int value = command_value.toInt();
//or
float value = command_value.toFloat();
}
So, why do we have a choice of text or number component types if things are handled as strings?
The data type is actually respected both on the ChipChop API servers and in the library so stuff like Actions can use logical evaluation like greater than > and less than < , logging graphs, gps coordinates etc...
It's only during transmission that it's "stringified" as it would unnecessarily inflate the library with additional c++ functions to automatically figure out and cast to numeric types and also it would require a more complicated ChipChop_onCommandReceived()
Let me know if this works ok
Regards
G