I have a Hue dimmer switch which stores 4 different values depending on how / how long a button was pressed, e.g. 1000, 1001, 1002, 1002 for button 1, 2000, 2001, 2003, 2004 for button 2 and so on. I would like to react to any form of how the button was pressed and was thinking about looking at the first digit only
switch substring(item, 1,1)
What would be the right way to get the first digit only from the state?