timeout`d promises
fixed refreshStates and aliased it to states
parse relay as int for switch (Fixes #1) + fix state bug