Removed duplicate method getCurrentDeviceState in device.js