Change output/input devices into dict