Fix switch list order sometimes changing when switches are changed

(due to randomisation of device order)