[SOLVED] Switch cases with multiple fall through cases on one then

So I have a Switch with many cases, everything works flawlessly.

Yesterday I wanted to use the same “then” for two cases so I proceeded accordingly as I’ve seen here.

Problem is, this did not work.

I even tried using : instead of the suggested comma. Did not worked.

Also tried without anything, having them like:

case “BLA”
case “BLE” : {

Did not worked as well.

If I leave one case for each then as I had previously, everything works like a charm though.

Any suggestions?

EDIT: I’m using OH v2.5.9

See this example of mine:

switch (System_SSH_LetzteFehlgeschlageneIP.state.toString) {
    case "1", case "2" : { text = text + "(RPi2Helper)" }
    case "3" : { text = text + "(Asterix)" }
    default: { text = text + "(unbekannt)" }
}

This works perfectly fine for me

2 Likes

I really can’t understand this… :man_facepalming:

I swear I had tried this (like in the link I’ve shared) and it did not worked.

Tried again now… IT WORKED!

Welp… thanks. lol

1 Like