NCO
(E. Gerland)
1
All,
I get a long string using curl from a website.
From the response I extract multiple states like „OFF“ as a string.
Currently I check something like:
if(string.state == „OFF“) {
Switch.postUpdate(OFF).
}
I have seen something more straight forward somewhere like with a transform „OFF“ to switch state OFF within one LOC.
I cannot find it again, though.
Could someone please give me a hint?
vzorglub
(Vincent Regaud)
3
The postUpdate and sendCommand accept strings too:
Switch.postUpdate(string.state.toString).
The toString
is there to force the DSL parser to pass a string just in case
NCO
(E. Gerland)
4
Cool stuff.
Thanks a lot.
NCO
(E. Gerland)
5
Thanks for your response.
As always, I will check out your design pattern tips as well
Very helpful, Rich!