[SOLVED] Using number item as array key for string representation

Hi all,

I’ve tried to look everywhere I could but I couldn’t find the answer for my predicament. I’m trying to store a variable that I will be using across rules as well as present in HabPanel so I’ve followed advice to create an item for it.
I’m trying to make a single 2-key switch control multiple devices. The idea is B1 cycles through states 0-5 and B2 toggles on/off. Based on the state number, the on/off toggle will apply to different items.
I’ve managed to implement the logic but I’m having difficulty presenting the state in a readable format to the user. I’d like to attach text representations to each state value. Ideally I’d be using the state value as a key to select from a string array. How do I work this into HabPanel?
Edit: I’ve tried using ng-switch but it seems like the value does not update if the item value updates

Would you not use a MAP?