Merge "Add MAX/MIN_DEVICE_STATE constants to restrict possible states to range." into sc-dev