Webcore switch case question


#1

1) Give a description of the problem
Can’t find method to add multiple valuse to case

2) What is the expected behaviour?
to work as standard groovy

3) What is happening/not happening?
not working

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

integer fred = 2
switch ({fred})
case [1:2:3:4]
or
case 1…4

any syntax I use is auto bracketed or quoted - basically made useless
I can get this working in groovy directly, but not in webcore (hubitat)
I want to put a range or a selection of items to be tested (ceased) against.
What am I missing ?


#3

You need to change the Case type to Range:


#4

Woah, you’re alive lol


#5

Thanks
Another well hidden option.
I’ll have to keep check the options of everything I use.
I searched and searched (internet and documentation) found nothing.

My thanks again.


#6

Mainly lurking here and in the Hubitat forums, but I’ll click on those heart-shaped thingies at the bottom of posts every now and then, LOL.

Now that I think about it, I haven’t created a new piston in about a year and a half since all my pistons have been working fine in Hubitat webCoRE.