MyMessage entity number in stead of name
-
Hi!
I'm new to MySensors and i'm currently making a OTGW logger (see http://otgw.tclcode.com)
I want to make the code flexible because not everybody wants to log every message of the OTGW. The code is already finished but i only have one thing i want improve.
Now i have:MyMessage pressure(1,V_PRESSURE); MyMessage set_temp(2,V_TEMP); ...... many moreAnd at the sending part i have:
switch(ID) { case 1: send(pressure.set(value)); break; case 2: send(set_tep.set(value)); break; ....many more cases.... }I want to do something like:
MyMessage 1(1,V_PRESSURE); MyMessage 2(2,V_TEMP); .......and at the sending part i can just do:
send(ID.set(value));But that wouldn't compile because it is a number i think in stead of a name.
Does anyone know a nice way to do it?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login