Add state classes to device elements