Search

Register

Thanks for signing-up! You will receive an email with further instructions to activate your account!

username already taken
You already have an account? .

Login

Forgot password?
Don't have an account yet? Register now for using the UI-Designer and the forum or creating projects.
Login to create topics and posts!



Response Handling example python code?

#1 Jan. 14, 2019 18:57:30 by francolargo

Response Handling example python code?

Hello,

I'm upgrading my NetIO controller and would like to group 6 buttons so that the return from any one button-press updates the other 5 button labels as well. Then there will be no confusion as to which of the six buttons has control of the system.

Is there example code from the python server in this forum from somebody who has done that?
or…
Could somebody better describe the needed python syntax to return 6 discrete text strings in response to one remote command?

Many thanks in advance!

Frank

#2 Jan. 14, 2019 22:04:33 by mcgiver0510

Response Handling example python code?

hi Frank,

with event Based Connection you can do that
You must use a separator in your send string
the separator must not be present in the RegEx rule

Example :
parseResponse : Button1#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}
parseResponse : Button2#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}
parseResponse : Button3#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}
parseResponse : Button4#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}
parseResponse : Button5#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}
parseResponse : Button6#([A-Za-z0-9\s]{0,30})
formatResponse : {0.1}

a shorter spelling could look like this :
parseResponse  :Button1#([\w\s]{0,30})
formatResponse : {0.1}

the send string for this could look like this :
Button1#first Button;Button2#second Button;Button3#third Button;Button4#fourth Button;Button5#fifth Button;Button6#sixth Button\n
The separator here is the semicolon.
It is not allowed in the RegEx rule.

I hope this helps you

Ps :
by the way - your project “ Audio Controller for BBB ” is absolutely great
i also use a BBB to control my garden lighting via DMX

lg
kalli


Edited mcgiver0510 (Jan. 14, 2019 22:40:40)