Yup that would do it.
I think i had set them up operationMode as the setting preference and operatingMode as the attribute, but I’ll need to go through it to double check. This is because if the setting preference (operationMode) is changed, the switch’s mode (operatingMode) may not reflect the setting - especially if you use webcore or the tile to change the mode.
For example I might set it to occupancy in the settings click done and toggle it to vacancy with the tile. The setting will remain “occupancy” but the mode would change to vacancy. The setting would remain that way (but not get sent to the device) until the next time “done” is pressed. It would be nice to be able to change the settings for the device if changed via another method to keep them in sync, but last I looked smartthings did not let device handler settings to be changed this way. (for security reasons I’m sure.)
Either way I should probably clarify the naming of these two somehow and add some comments for readability.
Yes, this looks much better.
I committed the fix for the tile and format to github.
Thanks a ton for fixing this!